aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMax K. <[email protected]>2015-07-30 20:37:58 +0200
committerMax K. <[email protected]>2015-07-30 20:37:58 +0200
commit2bb124df3f0c15bd79b54655ea2ee146dd2e8201 (patch)
treed7f21bfe9765f7282c4719ef80d9621b0fbc34d7 /src/main.cpp
parentMerge pull request #1206 from rnicoll/1.10-txdb (diff)
parentdoc: add important information about tx flood to release notes (diff)
downloaddiscoin-2bb124df3f0c15bd79b54655ea2ee146dd2e8201.tar.xz
discoin-2bb124df3f0c15bd79b54655ea2ee146dd2e8201.zip
Merge pull request #1207 from rnicoll/1.10-bitcoin
Bring client up to date with Bitcoin Core 0.11.0
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 35c4ae7c0..b42638096 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -436,13 +436,14 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<CBl
// Iterate over those blocks in vToFetch (in forward direction), adding the ones that
// are not yet downloaded and not in flight to vBlocks. In the mean time, update
- // pindexLastCommonBlock as long as all ancestors are already downloaded.
+ // pindexLastCommonBlock as long as all ancestors are already downloaded, or if it's
+ // already part of our chain (and therefore don't need it even if pruned).
BOOST_FOREACH(CBlockIndex* pindex, vToFetch) {
if (!pindex->IsValid(BLOCK_VALID_TREE)) {
// We consider the chain that this peer is on invalid.
return;
}
- if (pindex->nStatus & BLOCK_HAVE_DATA) {
+ if (pindex->nStatus & BLOCK_HAVE_DATA || chainActive.Contains(pindex)) {
if (pindex->nChainTx)
state->pindexLastCommonBlock = pindex;
} else if (mapBlocksInFlight.count(pindex->GetBlockHash()) == 0) {