diff options
author | R E Broadley <rebroad+github@gmail.com> | 2014-07-03 15:28:38 +0700 |
---|---|---|
committer | R E Broadley <rebroad+github@gmail.com> | 2014-07-16 18:00:34 +0700 |
commit | 604ee2aa7d110439b4e59ecaa272b85ec41ab6a0 (patch) | |
tree | 764658fe74462f0afb0e2b8d1f1b66905e16fbdc | |
parent | 87e40799fdebb9f4c3c9d8cc7d071408a4ea768e (diff) | |
download | bitcoin-604ee2aa7d110439b4e59ecaa272b85ec41ab6a0.tar.xz |
Remove tx from AlreadyAskedFor list once we receive it, not when we process it.
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 442feea471..0cbf3b07ff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3894,15 +3894,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, bool fMissingInputs = false; CValidationState state; + + mapAlreadyAskedFor.erase(inv); + if (AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs)) { mempool.check(pcoinsTip); RelayTransaction(tx); - mapAlreadyAskedFor.erase(inv); vWorkQueue.push_back(inv.hash); vEraseQueue.push_back(inv.hash); - LogPrint("mempool", "AcceptToMemoryPool: peer=%d %s : accepted %s (poolsz %u)\n", pfrom->id, pfrom->cleanSubVer, tx.GetHash().ToString(), @@ -3928,7 +3929,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, { LogPrint("mempool", " accepted orphan tx %s\n", orphanHash.ToString()); RelayTransaction(orphanTx); - mapAlreadyAskedFor.erase(CInv(MSG_TX, orphanHash)); vWorkQueue.push_back(orphanHash); vEraseQueue.push_back(orphanHash); } |