mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
validation: Add and use HaveTxsDownloaded where appropriate
This commit is contained in:
@@ -566,7 +566,7 @@ static void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vec
|
||||
return;
|
||||
}
|
||||
if (pindex->nStatus & BLOCK_HAVE_DATA || chainActive.Contains(pindex)) {
|
||||
if (pindex->nChainTx)
|
||||
if (pindex->HaveTxsDownloaded())
|
||||
state->pindexLastCommonBlock = pindex;
|
||||
} else if (mapBlocksInFlight.count(pindex->GetBlockHash()) == 0) {
|
||||
// The block is not already downloaded, and not yet in flight.
|
||||
@@ -1124,7 +1124,7 @@ void static ProcessGetBlockData(CNode* pfrom, const CChainParams& chainparams, c
|
||||
LOCK(cs_main);
|
||||
const CBlockIndex* pindex = LookupBlockIndex(inv.hash);
|
||||
if (pindex) {
|
||||
if (pindex->nChainTx && !pindex->IsValid(BLOCK_VALID_SCRIPTS) &&
|
||||
if (pindex->HaveTxsDownloaded() && !pindex->IsValid(BLOCK_VALID_SCRIPTS) &&
|
||||
pindex->IsValid(BLOCK_VALID_TREE)) {
|
||||
// If we have the block and all of its parents, but have not yet validated it,
|
||||
// we might be in the middle of connecting it (ie in the unlock of cs_main
|
||||
|
||||
Reference in New Issue
Block a user