diff --git a/changelog.txt b/changelog.txt index c000b5a379..8d0efafbf4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +1.6.4.4 + +RPC - Fix an issue with the 'unlock' callback of 'walletpassphrase' whereby it could temporarily freeze the main RPC thread. In most cases this would result in slow RPC but in extreme cases it could be so slow that the slowness would then cascade into other parts of the program (e.g. peers timing out) presenting as a frozen RPC that no longer +responds. + 1.6.4.3 Maintenance release in preparation for 2.0 release. diff --git a/configure.ac b/configure.ac index 5874152ec9..05f84084cd 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 1) define(_CLIENT_VERSION_MINOR, 6) define(_CLIENT_VERSION_REVISION, 4) -define(_CLIENT_VERSION_BUILD, 3) +define(_CLIENT_VERSION_BUILD, 4) define(_CLIENT_VERSION_IS_RELEASE, false) define(_COPYRIGHT_YEAR, 2016) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/src/clientversion.h b/src/clientversion.h index 605fa325b0..a894c6bf53 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -17,7 +17,7 @@ #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 6 #define CLIENT_VERSION_REVISION 4 -#define CLIENT_VERSION_BUILD 3 +#define CLIENT_VERSION_BUILD 4 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE false diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 830215488f..07bf9e8446 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -36,6 +36,8 @@ #include #include +#include + using namespace std; int64_t nWalletUnlockTime; @@ -1966,9 +1968,14 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp) static void LockWallet(CWallet* pWallet) { - LOCK(cs_nWalletUnlockTime); - nWalletUnlockTime = 0; - pWallet->Lock(); + + std::thread( + [=] { + DS_LOCK2(cs_main, pWallet->cs_wallet); + LOCK(cs_nWalletUnlockTime); + nWalletUnlockTime = 0; + pWallet->Lock(); + }).detach(); } UniValue walletpassphrase(const UniValue& params, bool fHelp) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 0a9c5f2c29..53a142ed3c 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -773,7 +773,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet, WalletLoadState& nExtraLoadStat } else { pwallet->activeAccount = pwallet->mapAccounts[primaryAccountString]; } - } else if (isPreHDWallet) { + } else if (isPreHDWallet && !haveAnyAccounts) { nExtraLoadState = EXISTING_WALLET_OLDACCOUNTSYSTEM; if (pwallet->activeAccount == NULL && pwallet->activeSeed == NULL) {