Skip to content

Commit 99d9689

Browse files
ajtownssdaftuar
authored andcommitted
[refactor] swap if/else order
1 parent 9b7978e commit 99d9689

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,11 +2546,11 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
25462546
// Never relay transactions that we would assign a non-zero DoS
25472547
// score for, as we expect peers to do the same with us in that
25482548
// case.
2549-
if (!state.IsInvalid() || !MayResultInDisconnect(state, false)) {
2549+
if (state.IsInvalid() && MayResultInDisconnect(state, false)) {
2550+
LogPrintf("Not relaying invalid transaction %s from whitelisted peer=%d (%s)\n", tx.GetHash().ToString(), pfrom->GetId(), FormatStateMessage(state));
2551+
} else {
25502552
LogPrintf("Force relaying tx %s from whitelisted peer=%d\n", tx.GetHash().ToString(), pfrom->GetId());
25512553
RelayTransaction(tx, connman);
2552-
} else {
2553-
LogPrintf("Not relaying invalid transaction %s from whitelisted peer=%d (%s)\n", tx.GetHash().ToString(), pfrom->GetId(), FormatStateMessage(state));
25542554
}
25552555
}
25562556
}

0 commit comments

Comments
 (0)