Skip to content

Commit fc66d0a

Browse files
adamjonasamitiuttarwar
authored andcommitted
[p2p] Check for nullptr before dereferencing pointer
1 parent cb79b9d commit fc66d0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,8 +1509,9 @@ void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman&
15091509
{
15101510
LockAssertion lock(::cs_main);
15111511

1512-
CNodeState &state = *State(pnode->GetId());
1513-
if (state.m_wtxid_relay) {
1512+
CNodeState* state = State(pnode->GetId());
1513+
if (state == nullptr) return;
1514+
if (state->m_wtxid_relay) {
15141515
pnode->PushTxInventory(wtxid);
15151516
} else {
15161517
pnode->PushTxInventory(txid);

0 commit comments

Comments
 (0)