Skip to content

Commit e237823

Browse files
committed
validate non null pfrom on blockspamfilter check
1 parent c2e5459 commit e237823

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4793,15 +4793,15 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis
47934793
}
47944794

47954795
// Store to disk
4796-
CBlockIndex* pindex = NULL;
4796+
CBlockIndex* pindex = nullptr;
47974797
bool ret = AcceptBlock (*pblock, state, &pindex, dbp, checked);
47984798
if (pindex && pfrom) {
47994799
mapBlockSource[pindex->GetBlockHash ()] = pfrom->GetId ();
48004800
}
48014801
CheckBlockIndex ();
48024802
if (!ret) {
48034803
// Check spamming
4804-
if(GetBoolArg("-blockspamfilter", DEFAULT_BLOCK_SPAM_FILTER)) {
4804+
if(pfrom && GetBoolArg("-blockspamfilter", DEFAULT_BLOCK_SPAM_FILTER)) {
48054805
CNodeState *nodestate = State(pfrom->GetId());
48064806
nodestate->nodeBlocks.onBlockReceived(pindex->nHeight);
48074807
bool nodeStatus = true;

0 commit comments

Comments
 (0)