diff options
| author | Jeff Garzik <[email protected]> | 2015-10-01 05:58:51 -0400 |
|---|---|---|
| committer | Jeff Garzik <[email protected]> | 2015-10-01 05:58:51 -0400 |
| commit | cf9bb11f97dbff428e9aee3b65e068d70af08e17 (patch) | |
| tree | bdea635cc8deb4925b0c7697f0a218d1f535b2b5 /src/main.cpp | |
| parent | Merge pull request #5924 (diff) | |
| parent | In (strCommand == "tx"), return if AlreadyHave() (diff) | |
| download | discoin-cf9bb11f97dbff428e9aee3b65e068d70af08e17.tar.xz discoin-cf9bb11f97dbff428e9aee3b65e068d70af08e17.zip | |
Merge pull request #6588
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index e919a2077..e8a6edc22 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4280,6 +4280,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); @@ -4355,13 +4359,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 |