mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
[p2p] Check for nullptr before dereferencing pointer
This commit is contained in:
parent
cb79b9dbf4
commit
fc66d0a65c
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue