diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index 7c84b258cf..3193dd7582 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -217,7 +217,7 @@ void LedgerConsensus::takeInitialPosition(Ledger::pointer initialLedger) mOurPosition = boost::make_shared (theConfig.VALIDATION_SEED, initialLedger->getParentHash(), txSet); - mapComplete(txSet, initialSet); + mapComplete(txSet, initialSet, false); propose(std::vector(), std::vector()); } @@ -241,9 +241,10 @@ void LedgerConsensus::createDisputes(SHAMap::pointer m1, SHAMap::pointer m2) } } -void LedgerConsensus::mapComplete(const uint256& hash, SHAMap::pointer map) +void LedgerConsensus::mapComplete(const uint256& hash, SHAMap::pointer map, bool acquired) { - Log(lsINFO) << "We have acquired TXS " << hash.GetHex(); + if (acquired) + Log(lsINFO) << "We have acquired TXS " << hash.GetHex(); mAcquiring.erase(hash); if (!map) @@ -281,8 +282,8 @@ void LedgerConsensus::mapComplete(const uint256& hash, SHAMap::pointer map) } if (!peers.empty()) adjustCount(map, peers); - else if (!hash) - Log(lsWARNING) << "By the time we got the map, no peers were proposing it"; + else if (acquired) + Log(lsWARNING) << "By the time we got the map " << hash.GetHex() << " no peers were proposing it"; sendHaveTxSet(hash, true); } @@ -448,7 +449,7 @@ bool LedgerConsensus::updateOurPositions(int sinceClose) uint256 newHash = ourPosition->getHash(); mOurPosition->changePosition(newHash); propose(addedTx, removedTx); - mapComplete(newHash, ourPosition); + mapComplete(newHash, ourPosition, false); Log(lsINFO) << "We change our position to " << newHash.GetHex(); } @@ -468,7 +469,7 @@ SHAMap::pointer LedgerConsensus::getTransactionTree(const uint256& hash, bool do if (!hash) { SHAMap::pointer empty = boost::make_shared(); - mapComplete(hash, empty); + mapComplete(hash, empty, false); return empty; } acquiring = boost::make_shared(hash); diff --git a/src/LedgerConsensus.h b/src/LedgerConsensus.h index a02bbce88a..60d4c27962 100644 --- a/src/LedgerConsensus.h +++ b/src/LedgerConsensus.h @@ -138,7 +138,7 @@ public: SHAMap::pointer getTransactionTree(const uint256& hash, bool doAcquire); TransactionAcquire::pointer getAcquiring(const uint256& hash); - void mapComplete(const uint256& hash, SHAMap::pointer map); + void mapComplete(const uint256& hash, SHAMap::pointer map, bool acquired); void abort(); int timerEntry(); diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 540efeca45..e38cb2b243 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -541,7 +541,7 @@ bool NetworkOPs::hasTXSet(boost::shared_ptr peer, const uint256& set, newc void NetworkOPs::mapComplete(const uint256& hash, SHAMap::pointer map) { if (mConsensus) - mConsensus->mapComplete(hash, map); + mConsensus->mapComplete(hash, map, true); } void NetworkOPs::endConsensus()