From a389e19580e4fc1a6aa1bdf74388d3831c847a01 Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 30 Jun 2019 10:55:47 -0400 Subject: [PATCH] ready to implement relayTxs(); tx->isDoubleSpend depends on isFailed and isRelayed; --- src/wallet/MoneroWallet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 3d9d5bd..050f551 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -1150,11 +1150,11 @@ namespace monero { // init other known fields tx->isConfirmed = false; tx->isCoinbase = false; - tx->isFailed = false; - tx->isDoubleSpend = false; + tx->isFailed = false; // TODO: test and handle if true tx->doNotRelay = request.doNotRelay != boost::none && request.doNotRelay.get() == true; tx->isRelayed = tx->doNotRelay.get() != true; tx->inTxPool = !tx->doNotRelay.get(); + if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpend = false; // TODO: test and handle if true tx->numConfirmations = 0; tx->mixin = request.mixin; tx->unlockTime = request.unlockTime == boost::none ? 0 : request.unlockTime.get(); @@ -1403,7 +1403,7 @@ namespace monero { tx->isRelayed = !tx->isFailed.get(); tx->inTxPool = !tx->isFailed.get(); tx->doNotRelay = false; - tx->isDoubleSpend = false; // TODO: test, detect, and set double spend + if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpend = false; // TODO: test and handle if true tx->numConfirmations = 0; // construct transfer