mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
rpc: Round verificationprogress to exactly 1 for a recent tip
This requires a new lock annotation, but all relevant callers already held the lock.
This commit is contained in:
@@ -326,7 +326,8 @@ public:
|
||||
}
|
||||
double getVerificationProgress() override
|
||||
{
|
||||
return chainman().GuessVerificationProgress(WITH_LOCK(chainman().GetMutex(), return chainman().ActiveChain().Tip()));
|
||||
LOCK(chainman().GetMutex());
|
||||
return chainman().GuessVerificationProgress(chainman().ActiveTip());
|
||||
}
|
||||
bool isInitialBlockDownload() override
|
||||
{
|
||||
@@ -409,6 +410,7 @@ public:
|
||||
std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) override
|
||||
{
|
||||
return MakeSignalHandler(::uiInterface.NotifyBlockTip_connect([fn, this](SynchronizationState sync_state, const CBlockIndex* block) {
|
||||
LOCK(chainman().GetMutex());
|
||||
fn(sync_state, BlockTip{block->nHeight, block->GetBlockTime(), block->GetBlockHash()},
|
||||
chainman().GuessVerificationProgress(block));
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user