mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-19 05:12:03 +02:00
[p2p] Check for nullptr before dereferencing pointer
This commit is contained in:
parent
cb79b9dbf4
commit
fc66d0a65c
@ -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…
x
Reference in New Issue
Block a user