Also stop asking other peers for a TX when ProcessTxLockRequest fails (#2529)

This is moving up the RemoveAskFor call above the ProcessTxLockRequest
call. If ProcessTxLockRequest fails, we should not re-request the same
TX/IX from other nodes as it will continue to fail.
This commit is contained in:
Alexander Block 2018-12-06 08:08:54 +01:00 committed by GitHub
parent 19a6f718d3
commit 7c75008642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2037,6 +2037,10 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
CInv inv(nInvType, tx.GetHash());
pfrom->AddInventoryKnown(inv);
{
LOCK(cs_main);
connman.RemoveAskFor(inv.hash);
}
// Process custom logic, no matter if tx will be accepted to mempool later or not
if (strCommand == NetMsgType::TXLOCKREQUEST || fCanAutoLock) {
@ -2083,8 +2087,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
LOCK(cs_main);
connman.RemoveAskFor(inv.hash);
bool fMissingInputs = false;
CValidationState state;