diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2018-02-25 09:05:34 +0800 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2018-02-25 09:13:43 +0800 |
commit | bf3353de90598f08a68d966c50b57ceaeb5b5d96 (patch) | |
tree | 9a82d0a0149581eb84d1a9c2680523444a818363 /src/validation.cpp | |
parent | 07090c5339436f856e79a8036d1c85deeb453803 (diff) | |
parent | 90ba2df11b5bc943ac48b49b5da8023864dc842d (diff) | |
download | bitcoin-bf3353de90598f08a68d966c50b57ceaeb5b5d96.tar.xz |
Merge #12287: Optimise lock behaviour for GuessVerificationProgress()
90ba2df11 Fix missing cs_main lock for GuessVerificationProgress() (Jonas Schnelli)
Pull request description:
`GuessVerificationProgress()` needs `cs_main` due to accessing the `pindex->nChainTx`.
This adds a `AssertLockHeld` in `GuessVerificationProgress()` and adds the missing locks in...
* `LoadChainTip()`
* `ScanForWalletTransactions()` (got missed in #11281)
* GUI, `ClientModel::getVerificationProgress()` <--- **this may have GUI performance impacts**, but could be relaxed later with a cache or something more efficient.
Tree-SHA512: 13302946571422375f32af8e396b9d2c1180f2693ea363aeba9e98c8266ddec64fe7862bfdcbb5a93a4b12165a61eec1e51e4e7d7a8515fa50879095dc163412
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index e809f66e25..d2438b0609 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4658,6 +4658,7 @@ bool DumpMempool(void) } //! Guess how far we are in the verification process at the given block index +//! require cs_main if pindex has not been validated yet (because nChainTx might be unset) double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pindex) { if (pindex == nullptr) return 0.0; |