From aab23aef72132ddcc5ef49a97d900e5e35c4dfe6 Mon Sep 17 00:00:00 2001 From: woodser Date: Sat, 22 Jun 2019 13:35:43 -0400 Subject: [PATCH] no otherBlock cast --- src/daemon/MoneroDaemonModel.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/daemon/MoneroDaemonModel.cpp b/src/daemon/MoneroDaemonModel.cpp index 472a152..80e46f4 100644 --- a/src/daemon/MoneroDaemonModel.cpp +++ b/src/daemon/MoneroDaemonModel.cpp @@ -87,17 +87,14 @@ namespace monero { // merge header fields MoneroBlockHeader::merge(self, other); - // convert other to MoneroBlock* - MoneroBlock* otherBlock = static_cast(other.get()); - // merge coinbase tx - if (coinbaseTx == boost::none) coinbaseTx = otherBlock->coinbaseTx; - else if (otherBlock->coinbaseTx != boost::none) coinbaseTx.get()->merge(*coinbaseTx, *otherBlock->coinbaseTx); + if (coinbaseTx == boost::none) coinbaseTx = other->coinbaseTx; + else if (other->coinbaseTx != boost::none) coinbaseTx.get()->merge(*coinbaseTx, *other->coinbaseTx); // merge non-coinbase txs - if (txs.empty()) txs = otherBlock->txs; - else if (!otherBlock->txs.empty()) { - for (const shared_ptr& thatTx : otherBlock->txs) { + if (txs.empty()) txs = other->txs; + else if (!other->txs.empty()) { + for (const shared_ptr& thatTx : other->txs) { bool found = false; for (const shared_ptr& thisTx : txs) { if (thatTx->id == thisTx->id) { @@ -116,8 +113,8 @@ namespace monero { } // merge other fields - hex = MoneroUtils::reconcile(hex, otherBlock->hex); - txIds = MoneroUtils::reconcile(txIds, otherBlock->txIds); + hex = MoneroUtils::reconcile(hex, other->hex); + txIds = MoneroUtils::reconcile(txIds, other->txIds); } // ------------------------------- MONERO TX --------------------------------