From 70a8779e481acc550de8d5b4e133c9bc533a022c Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 30 Jul 2019 10:59:26 -0400 Subject: [PATCH] implement output request and wallet copy() --- src/wallet/MoneroWalletModel.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/wallet/MoneroWalletModel.cpp b/src/wallet/MoneroWalletModel.cpp index eac187b..ff792ed 100644 --- a/src/wallet/MoneroWalletModel.cpp +++ b/src/wallet/MoneroWalletModel.cpp @@ -532,9 +532,15 @@ namespace monero { if (this != src.get()) throw runtime_error("this != src"); // copy base class - MoneroOutputWallet::copy(static_pointer_cast(src), static_pointer_cast(tgt)); + MoneroOutput::copy(static_pointer_cast(src), static_pointer_cast(tgt)); - throw runtime_error("MoneroOutputWallet::copy(outputWallet) not implemented"); + // copy extensions + tgt->accountIndex = src->accountIndex; + tgt->subaddressIndex = src->subaddressIndex; + tgt->isSpent = src->isSpent; + tgt->isUnlocked = src->isUnlocked; + tgt->isFrozen = src->isFrozen; + return tgt; }; boost::property_tree::ptree MoneroOutputWallet::toPropertyTree() const { @@ -566,9 +572,15 @@ namespace monero { }; shared_ptr MoneroOutputRequest::copy(const shared_ptr& src, const shared_ptr& tgt) const { - throw runtime_error("MoneroOutputRequest::copy(outputRequest) not implemented"); + MTRACE("MoneroOutputRequest::copy(outputRequest)"); if (this != src.get()) throw runtime_error("this != src"); - throw runtime_error("MoneroOutputRequest::copy() not implemented"); + + // copy base class + MoneroOutputWallet::copy(static_pointer_cast(src), static_pointer_cast(tgt)); + + // copy extensions + if (!src->subaddressIndices.empty()) tgt->subaddressIndices = vector(src->subaddressIndices); + return tgt; }; boost::property_tree::ptree MoneroOutputRequest::toPropertyTree() const {