From d43b2d5479371641c976cbd540b579bde4584ec8 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 11 Jun 2019 13:18:52 -0400 Subject: [PATCH] compiling with daemon model merge definition --- src/daemon/MoneroDaemon.cpp | 11 +++++++++++ src/daemon/MoneroDaemon.h | 3 +++ src/wallet/MoneroWallet.cpp | 6 +++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/daemon/MoneroDaemon.cpp b/src/daemon/MoneroDaemon.cpp index 130d72b..b4c5b3d 100644 --- a/src/daemon/MoneroDaemon.cpp +++ b/src/daemon/MoneroDaemon.cpp @@ -98,6 +98,17 @@ namespace monero { // -------------------------- MODEL IMPLEMENTATION -------------------------- + void MoneroBlockHeader::merge(const MoneroBlockHeader& header) { + throw runtime_error("Not implemented"); + } + + void MoneroBlock::merge(const MoneroBlock& block) { + throw runtime_error("Not implemented"); + } + + void MoneroTx::merge(const MoneroTx& tx) { + throw runtime_error("Not implemented"); + } // ---------------------------- PRIVATE HELPERS ----------------------------- diff --git a/src/daemon/MoneroDaemon.h b/src/daemon/MoneroDaemon.h index 3cb1b36..87cbd3c 100644 --- a/src/daemon/MoneroDaemon.h +++ b/src/daemon/MoneroDaemon.h @@ -82,6 +82,7 @@ namespace monero { boost::optional powHash; boost::property_tree::ptree toPropertyTree() const; + void merge(const MoneroBlockHeader& header); }; /** @@ -94,6 +95,7 @@ namespace monero { vector txIds; boost::property_tree::ptree toPropertyTree() const; + void merge(const MoneroBlock& block); }; /** @@ -145,6 +147,7 @@ namespace monero { if (block == boost::none) return boost::none; return *((*block)->height); } + void merge(const MoneroTx& tx); }; /** diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index f14f875..d119530 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -209,16 +209,16 @@ namespace monero { (*tx->block)->txs = txs; (*tx->block)->height = *aTx->getHeight(); } - //aTx->block->merge(tx->block); + (*aTx->block)->merge(**tx->block); } else { - //aTx->merge(*tx); + aTx->merge(*tx); } return; } // merge common block of different txs if (tx->getHeight() != boost::none && *tx->getHeight() == *aTx->getHeight()) { - //(*aTx-block)->merge(*tx->block); + (*aTx->block)->merge(**tx->block); //if (aTx.getIsConfirmed()) assertTrue(aTx.getBlock().getTxs().contains(aTx)); } }