mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05: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);
|
LockAssertion lock(::cs_main);
|
||||||
|
|
||||||
CNodeState &state = *State(pnode->GetId());
|
CNodeState* state = State(pnode->GetId());
|
||||||
if (state.m_wtxid_relay) {
|
if (state == nullptr) return;
|
||||||
|
if (state->m_wtxid_relay) {
|
||||||
pnode->PushTxInventory(wtxid);
|
pnode->PushTxInventory(wtxid);
|
||||||
} else {
|
} else {
|
||||||
pnode->PushTxInventory(txid);
|
pnode->PushTxInventory(txid);
|
||||||
|
|
Loading…
Add table
Reference in a new issue