Merge pull request #2009 from sipa/fixmove

Prevent RPC 'move' from deadlocking
This commit is contained in:
Gavin Andresen
2012-11-16 08:09:41 -08:00
3 changed files with 10 additions and 6 deletions

View File

@@ -291,10 +291,14 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
return true;
}
int64 CWallet::IncOrderPosNext()
int64 CWallet::IncOrderPosNext(CWalletDB *pwalletdb)
{
int64 nRet = nOrderPosNext;
CWalletDB(strWalletFile).WriteOrderPosNext(++nOrderPosNext);
int64 nRet = nOrderPosNext++;
if (pwalletdb) {
pwalletdb->WriteOrderPosNext(nOrderPosNext);
} else {
CWalletDB(strWalletFile).WriteOrderPosNext(nOrderPosNext);
}
return nRet;
}