diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-12-03 18:14:08 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-12-04 10:51:56 -0500 |
commit | fa4fc8856b239059421a8e507b3e3e7f4b379a72 (patch) | |
tree | 72b43baae4aafdcb9714f76ecb822a9b0fe63723 /src/net_processing.cpp | |
parent | ed12fd83ca7999a896350197533de5e9202bc2fe (diff) |
validation: Add and use HaveTxsDownloaded where appropriate
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index f4ab3aa153..40c5112578 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -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 |