Use txid as key in mapAlreadyAskedFor

Previously we used the CInv that would be sent to the peer announcing the
transaction as the key, but using the txid instead allows us to decouple the
p2p layer from the application logic (which relies on this map to avoid
duplicate tx requests).
This commit is contained in:
Suhas Daftuar
2016-04-11 12:52:29 -04:00
parent 934f2b5e76
commit 7e91f632c7
3 changed files with 5 additions and 5 deletions

View File

@@ -4956,7 +4956,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
CValidationState state;
pfrom->setAskFor.erase(inv.hash);
mapAlreadyAskedFor.erase(inv);
mapAlreadyAskedFor.erase(inv.hash);
CFeeRate txFeeRate = CFeeRate(0);
if (!AlreadyHave(inv) && AcceptToMemoryPool(mempool, state, tx, true, &fMissingInputs, &txFeeRate)) {