Skip to content

Commit

Permalink
[p2p] Check for nullptr before dereferencing pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjonas authored and amitiuttarwar committed Sep 4, 2020
1 parent cb79b9d commit fc66d0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/net_processing.cpp
Expand Up @@ -1509,8 +1509,9 @@ void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman&
{
LockAssertion lock(::cs_main);

CNodeState &state = *State(pnode->GetId());
if (state.m_wtxid_relay) {
CNodeState* state = State(pnode->GetId());
if (state == nullptr) return;
if (state->m_wtxid_relay) {
pnode->PushTxInventory(wtxid);
} else {
pnode->PushTxInventory(txid);
Expand Down

0 comments on commit fc66d0a

Please sign in to comment.