diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-12-07 14:02:30 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-12-07 14:59:30 +0100 |
| commit | f544e235563f77d5da959fa80249970752cc9811 (patch) | |
| tree | 46364622e6984a298e1c6253ead413023f656e6d /src/net_processing.cpp | |
| parent | Merge #14783: gui: Fix boost::signals2::no_slots_error in early calls to Init... (diff) | |
| parent | validation: Add and use HaveTxsDownloaded where appropriate (diff) | |
| download | discoin-f544e235563f77d5da959fa80249970752cc9811.tar.xz discoin-f544e235563f77d5da959fa80249970752cc9811.zip | |
Merge #14863: refactor: Add and use HaveTxsDownloaded() where appropriate
fa4fc8856b239059421a8e507b3e3e7f4b379a72 validation: Add and use HaveTxsDownloaded where appropriate (MarcoFalke)
Pull request description:
`nChainTx` is an implementation detail that shouldn't be exposed without a wrapper that comes with appropriate documentation.
Tree-SHA512: 56ab7378c2ce97794498724c271f861de982de69099e90ec09632a26230ae6fded3c59668adb378bd64dcb8ef714769b970210977b88a53fc7550774ddba3d59
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 f4ab3aa15..40c511257 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 |