Skip to content

Commit 15b48ab

Browse files
committed
Merge pull request #3047 from Diapolo/misbehave
special case DoS value == 0
2 parents acb3ebc + fbed9c9 commit 15b48ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3785,8 +3785,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
37853785
if (nEvicted > 0)
37863786
LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted);
37873787
}
3788-
int nDoS;
3789-
if (state.IsInvalid(nDoS))
3788+
int nDoS = 0;
3789+
if (state.IsInvalid(nDoS) && nDoS > 0)
37903790
pfrom->Misbehaving(nDoS);
37913791
}
37923792

@@ -3805,8 +3805,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
38053805
CValidationState state;
38063806
if (ProcessBlock(state, pfrom, &block))
38073807
mapAlreadyAskedFor.erase(inv);
3808-
int nDoS;
3809-
if (state.IsInvalid(nDoS))
3808+
int nDoS = 0;
3809+
if (state.IsInvalid(nDoS) && nDoS > 0)
38103810
pfrom->Misbehaving(nDoS);
38113811
}
38123812

0 commit comments

Comments
 (0)