[NOD-220] When handling an INV message, made it skip tx invs that are currently being requested. (#352)

This commit is contained in:
stasatdaglabs 2019-08-01 12:31:40 +03:00 committed by Svarog
parent 7c1cb47bd0
commit 2147d16c1f

View File

@ -967,11 +967,15 @@ func (sm *SyncManager) handleInvMsg(imsg *invMsg) {
}
if !haveInv {
if iv.Type == wire.InvTypeTx {
// Skip the transaction if it has already been
// rejected.
// Skip the transaction if it has already been rejected.
if _, exists := sm.rejectedTxns[daghash.TxID(*iv.Hash)]; exists {
continue
}
// Skip the transaction if it had previously been requested.
if _, exists := state.requestedTxns[daghash.TxID(*iv.Hash)]; exists {
continue
}
}
// Add it to the request queue.