From b94242c66daf1791238358876a37ea5f29f41748 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 30 Jun 2019 08:02:25 -0400 Subject: [PATCH] testSend() passing; send tx init lastRelayedTimestamp, accountIndex, subaddressIndices, destinations --- src/wallet/MoneroWallet.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 973f301..78a3f21 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -1,6 +1,7 @@ #include "MoneroWallet.h" #include "utils/MoneroUtils.h" +#include #include #include #include "mnemonics/electrum-words.h" @@ -1205,7 +1206,7 @@ namespace monero { auto txMetadatasIter = txMetadatas.begin(); while (txIdsIter != txIds.end()) { - // transfer filled values + // init tx with outgoing transfer from filled values shared_ptr tx = shared_ptr(new MoneroTxWallet()); txs.push_back(tx); tx->id = *txIdsIter; @@ -1217,7 +1218,7 @@ namespace monero { tx->outgoingTransfer = outTransfer; outTransfer->amount = *txAmountsIter; - // init common sent tx fields + // init other known fields tx->isConfirmed = false; tx->isCoinbase = false; tx->isFailed = false; @@ -1228,6 +1229,10 @@ namespace monero { tx->numConfirmations = 0; tx->mixin = request.mixin; tx->unlockTime = request.unlockTime == boost::none ? 0 : request.unlockTime.get(); + tx->lastRelayedTimestamp = static_cast(time(NULL)); + outTransfer->accountIndex = *request.accountIndex; + if (request.subaddressIndices.size() == 1) outTransfer->subaddressIndices.push_back(request.subaddressIndices[0]); // subaddress index is known iff 1 requested + outTransfer->destinations = request.destinations; // iterate to next element txKeysIter++;