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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user