Merge pull request #6785

36f14bf In (strCommand == "tx"), return if AlreadyHave() (Tom Harding)
This commit is contained in:
Wladimir J. van der Laan 2015-10-09 14:57:56 +02:00
commit b4dc33e9fb
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 7 additions and 7 deletions

View File

@ -4369,6 +4369,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
mapAlreadyAskedFor.erase(inv);
// Check for recently rejected (and do other quick existence checks)
if (AlreadyHave(inv))
return true;
if (AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs))
{
mempool.check(pcoinsTip);
@ -4444,13 +4448,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
if (nEvicted > 0)
LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted);
} else {
// AcceptToMemoryPool() returned false, possibly because the tx is
// already in the mempool; if the tx isn't in the mempool that
// means it was rejected and we shouldn't ask for it again.
if (!mempool.exists(tx.GetHash())) {
assert(recentRejects);
recentRejects->insert(tx.GetHash());
}
assert(recentRejects);
recentRejects->insert(tx.GetHash());
if (pfrom->fWhitelisted) {
// Always relay transactions received from whitelisted peers, even
// if they were rejected from the mempool, allowing the node to