Check that tx_relay is initialized before access

This commit is contained in:
Suhas Daftuar
2019-03-08 15:48:41 -05:00
parent c4aa2ba822
commit e75c39cd42
3 changed files with 138 additions and 121 deletions

View File

@@ -848,7 +848,7 @@ public:
void AddInventoryKnown(const CInv& inv)
{
{
if (m_tx_relay != nullptr) {
LOCK(m_tx_relay->cs_tx_inventory);
m_tx_relay->filterInventoryKnown.insert(inv.hash);
}
@@ -856,7 +856,7 @@ public:
void PushInventory(const CInv& inv)
{
if (inv.type == MSG_TX) {
if (inv.type == MSG_TX && m_tx_relay != nullptr) {
LOCK(m_tx_relay->cs_tx_inventory);
if (!m_tx_relay->filterInventoryKnown.contains(inv.hash)) {
m_tx_relay->setInventoryTxToSend.insert(inv.hash);