diff --git a/src/daemon/MoneroDaemonModel.cpp b/src/daemon/MoneroDaemonModel.cpp index 2c551bd..01aa53d 100644 --- a/src/daemon/MoneroDaemonModel.cpp +++ b/src/daemon/MoneroDaemonModel.cpp @@ -80,6 +80,10 @@ namespace monero { return node; } + void MoneroBlock::merge(const shared_ptr& self, const shared_ptr& other) { + merge(static_pointer_cast(self), static_pointer_cast(other)); + } + void MoneroBlock::merge(const shared_ptr& self, const shared_ptr& other) { if (this != self.get()) throw runtime_error("this != self"); if (self == other) return; diff --git a/src/daemon/MoneroDaemonModel.h b/src/daemon/MoneroDaemonModel.h index fc3b762..20c69e3 100644 --- a/src/daemon/MoneroDaemonModel.h +++ b/src/daemon/MoneroDaemonModel.h @@ -82,7 +82,7 @@ namespace monero { boost::optional powHash; boost::property_tree::ptree toPropertyTree() const; - void merge(const shared_ptr& self, const shared_ptr& other); + virtual void merge(const shared_ptr& self, const shared_ptr& other); }; /** @@ -95,6 +95,7 @@ namespace monero { vector txIds; boost::property_tree::ptree toPropertyTree() const; + void merge(const shared_ptr& self, const shared_ptr& other); void merge(const shared_ptr& self, const shared_ptr& other); }; @@ -144,7 +145,7 @@ namespace monero { boost::property_tree::ptree toPropertyTree() const; boost::optional getHeight() const; - void merge(const shared_ptr& self, const shared_ptr& other); + virtual void merge(const shared_ptr& self, const shared_ptr& other) ; }; /** @@ -170,6 +171,6 @@ namespace monero { boost::optional stealthPublicKey; boost::property_tree::ptree toPropertyTree() const; - void merge(const shared_ptr& self, const shared_ptr& other); + virtual void merge(const shared_ptr& self, const shared_ptr& other); }; } diff --git a/src/wallet/MoneroWalletModel.cpp b/src/wallet/MoneroWalletModel.cpp index 09a7c7c..fcad796 100644 --- a/src/wallet/MoneroWalletModel.cpp +++ b/src/wallet/MoneroWalletModel.cpp @@ -74,6 +74,11 @@ namespace monero { return !incomingTransfers.empty(); } + void MoneroTxWallet::merge(const shared_ptr& self, const shared_ptr& other) { + cout << "MoneroTxWallet::merge(MoneroTx&, MoneroTx&)" << endl; + merge(static_pointer_cast(self), static_pointer_cast(other)); + } + void MoneroTxWallet::merge(const shared_ptr& self, const shared_ptr& other) { cout << "MoneroTxWallet::merge()" << endl; if (this != self.get()) throw runtime_error("this != self"); @@ -382,11 +387,6 @@ namespace monero { return node; } - void MoneroOutputWallet::merge(const shared_ptr& self, const shared_ptr& other) { - cout << "MoneroOutputWallet::merge()" << endl; - throw runtime_error("not implemented"); - } - // ------------------------ MONERO OUTPUT REQUEST --------------------------- boost::property_tree::ptree MoneroOutputRequest::toPropertyTree() const { diff --git a/src/wallet/MoneroWalletModel.h b/src/wallet/MoneroWalletModel.h index d71f65e..20301f7 100644 --- a/src/wallet/MoneroWalletModel.h +++ b/src/wallet/MoneroWalletModel.h @@ -102,7 +102,7 @@ namespace monero { return !(*getIsIncoming()); } boost::property_tree::ptree toPropertyTree() const; - void merge(const shared_ptr& self, const shared_ptr& other); + virtual void merge(const shared_ptr& self, const shared_ptr& other); }; /** @@ -161,7 +161,6 @@ namespace monero { boost::optional isFrozen; boost::property_tree::ptree toPropertyTree() const; - void merge(const shared_ptr& self, const shared_ptr& other); }; /** @@ -189,6 +188,7 @@ namespace monero { bool getIsIncoming() const; bool getIsOutgoing() const; boost::property_tree::ptree toPropertyTree() const; + void merge(const shared_ptr& self, const shared_ptr& other); void merge(const shared_ptr& self, const shared_ptr& other); };