mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
validation: Add and use HaveTxsDownloaded where appropriate
This commit is contained in:
parent
ed12fd83ca
commit
fa4fc8856b
4 changed files with 24 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue