From 21c83377532cad9926bc59ddb9cf78e4deb37805 Mon Sep 17 00:00:00 2001 From: satyakoneru Date: Wed, 29 Jan 2020 23:20:36 +1100 Subject: [PATCH] SON165 - Keys mapping missing from wallet data (#274) --- libraries/wallet/wallet.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 1e9f306c..39b71b37 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -858,6 +858,7 @@ public: // account, false otherwise (but it is stored either way) bool import_key(string account_name_or_id, string wif_key) { + fc::scoped_lock lock(_resync_mutex); fc::optional optional_private_key = wif_to_key(wif_key); if (!optional_private_key) FC_THROW("Invalid private key"); @@ -1359,6 +1360,7 @@ public: bool broadcast = false, bool save_wallet = true) { try { + fc::scoped_lock lock(_resync_mutex); int active_key_index = find_first_unused_derived_key_index(owner_privkey); fc::ecc::private_key active_privkey = derive_private_key( key_to_wif(owner_privkey), active_key_index); @@ -1866,6 +1868,7 @@ public: flat_map sidechain_public_keys, bool broadcast /* = false */) { try { + fc::scoped_lock lock(_resync_mutex); account_object son_account = get_account(owner_account); fc::ecc::private_key active_private_key = get_private_key_for_account(son_account); int son_key_index = find_first_unused_derived_key_index(active_private_key); @@ -2082,6 +2085,7 @@ public: string url, bool broadcast /* = false */) { try { + fc::scoped_lock lock(_resync_mutex); account_object witness_account = get_account(owner_account); fc::ecc::private_key active_private_key = get_private_key_for_account(witness_account); int witness_key_index = find_first_unused_derived_key_index(active_private_key);