mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
validation: Check GuessVerificationProgress is not called with disconnected block
Use Assume macro as suggested https://github.com/bitcoin/bitcoin/pull/29370#discussion_r1479427801
This commit is contained in:
parent
63e8fc912c
commit
0fd915ee6b
1 changed files with 6 additions and 0 deletions
|
@ -5286,6 +5286,12 @@ double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pin
|
|||
if (pindex == nullptr)
|
||||
return 0.0;
|
||||
|
||||
if (!Assume(pindex->nChainTx > 0)) {
|
||||
LogWarning("Internal bug detected: block %d has unset nChainTx (%s %s). Please report this issue here: %s\n",
|
||||
pindex->nHeight, PACKAGE_NAME, FormatFullVersion(), PACKAGE_BUGREPORT);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
int64_t nNow = time(nullptr);
|
||||
|
||||
double fTxTotal;
|
||||
|
|
Loading…
Add table
Reference in a new issue