diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-04-15 12:43:17 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-04-17 16:46:01 +0200 |
| commit | e07c943ce8df6c6cb3ece3fc676911ddb43ca184 (patch) | |
| tree | c195a933389b7dc8f9eaf99730488dd35ee66206 /src/qt/transactionrecord.cpp | |
| parent | Translation update 2014-04 (diff) | |
| download | discoin-e07c943ce8df6c6cb3ece3fc676911ddb43ca184.tar.xz discoin-e07c943ce8df6c6cb3ece3fc676911ddb43ca184.zip | |
Add AssertLockHeld for cs_main to ChainActive-using functions
All functions that use ChainActive but do not aquire the cs_main
lock themselves, need to be called with the cs_main lock held.
This commit adds assertions to all externally callable functions
that use chainActive or chainMostWork.
This will flag usages when built with -DDEBUG_LOCKORDER.
Diffstat (limited to 'src/qt/transactionrecord.cpp')
| -rw-r--r-- | src/qt/transactionrecord.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 703a2b4e7..5a3728f49 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -150,6 +150,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet * void TransactionRecord::updateStatus(const CWalletTx &wtx) { + AssertLockHeld(cs_main); // Determine transaction status // Find the block the tx is in @@ -234,6 +235,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx) bool TransactionRecord::statusUpdateNeeded() { + AssertLockHeld(cs_main); return status.cur_num_blocks != chainActive.Height(); } |