[p2p] Check for nullptr before dereferencing pointer
This commit is contained in:
1 parent
cb79b9dbf4
commit
fc66d0a65c
1 file changed
+3
-2
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user