diff options
| author | Jeff Garzik <[email protected]> | 2011-04-04 22:24:35 -0400 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2011-04-04 22:24:35 -0400 |
| commit | f5f1878ba104a5d6a32eeb20b341326dca6086a5 (patch) | |
| tree | 39284fb8f9a1e82e7f66c49de833c2373dc54b8e /src/script.cpp | |
| parent | allow coredumps by not catching SIGSEGV (diff) | |
| download | discoin-f5f1878ba104a5d6a32eeb20b341326dca6086a5.tar.xz discoin-f5f1878ba104a5d6a32eeb20b341326dca6086a5.zip | |
Fix deadlocks in setaccount, sendfrom RPC calls
SendMoney*() now requires caller to acquire cs_main.
GetAccountAddress() now requires caller to acquire cs_main, cs_mapWallet.
Ordering is intended to match these two callchains[1]:
1. CRITICAL_BLOCK(cs_main)
ProcessMessage(pfrom, strCommand, vMsg)
AddToWalletIfMine()
AddToWallet(wtx)
CRITICAL_BLOCK(cs_mapWallet)
2. CRITICAL_BLOCK(cs_main)
ProcessMessage(pfrom, strCommand, vMsg)
AddToWalletIfMine()
AddToWallet(wtx)
CRITICAL_BLOCK(cs_mapWallet)
walletdb.WriteName(PubKeyToAddress(vchDefaultKey), "")
CRITICAL_BLOCK(cs_mapAddressBook)
Spotted by ArtForz. Additional deadlock fixes by Gavin.
[1] http://www.bitcoin.org/smf/index.php?topic=4904.msg71897#msg71897
Diffstat (limited to 'src/script.cpp')
0 files changed, 0 insertions, 0 deletions