From 01c26fd0ec76744392c4c8c616379ddcec5dab43 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 29 May 2019 17:39:11 -0400 Subject: [PATCH] call onNewBlock() iff listener registered --- src/wallet/MoneroWallet.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 9e04e81..dc30781 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -51,10 +51,12 @@ namespace monero { virtual void on_new_block(uint64_t height, const cryptonote::block& cnBlock) { - // notify listeners of block - MoneroBlock block; - block.height = height; - listener->onNewBlock(block); + // notify listener of block + if (this->listener != nullptr) { + MoneroBlock block; + block.height = height; + listener->onNewBlock(block); + } // notify listeners of sync progress if (syncStartHeight != nullptr && height > *syncStartHeight) {