Invert the condition for banning when mempool rejects a transaction

This commit is contained in:
Mike Zak 2021-06-07 14:07:25 +03:00
parent c099fd2986
commit 71875c99d6

View File

@ -180,10 +180,10 @@ func (flow *handleRelayedTransactionsFlow) receiveTransactions(requestedTransact
return errors.Wrapf(err, "failed to process transaction %s", txID)
}
shouldBan := true
shouldBan := false
if txRuleErr := (&mempool_old.TxRuleError{}); errors.As(ruleErr.Err, txRuleErr) {
if txRuleErr.RejectCode != mempool_old.RejectInvalid {
shouldBan = false
if txRuleErr.RejectCode == mempool_old.RejectInvalid {
shouldBan = true
}
}