diff options
| author | Adam Jonas <[email protected]> | 2020-08-17 16:35:03 -0400 |
|---|---|---|
| committer | Amiti Uttarwar <[email protected]> | 2020-09-04 14:37:44 -0700 |
| commit | fc66d0a65cdc52a3b259effe0c29b5eafb1b5ff5 (patch) | |
| tree | 91038075c24af22566cc62fe0d3b36862376d347 /src/net_processing.cpp | |
| parent | [mempool] Revert unbroadcast set to tracking just txid (diff) | |
| download | discoin-fc66d0a65cdc52a3b259effe0c29b5eafb1b5ff5.tar.xz discoin-fc66d0a65cdc52a3b259effe0c29b5eafb1b5ff5.zip | |
[p2p] Check for nullptr before dereferencing pointer
Diffstat (limited to 'src/net_processing.cpp')
| -rw-r--r-- | src/net_processing.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index e1007e071..578d93150 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -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); |