diff --git a/src/daemon/MoneroDaemonModel.cpp b/src/daemon/MoneroDaemonModel.cpp index 8a3b6e4..2020762 100644 --- a/src/daemon/MoneroDaemonModel.cpp +++ b/src/daemon/MoneroDaemonModel.cpp @@ -194,7 +194,7 @@ namespace monero { if (unlockTime != boost::none) node.put("unlockTime", *unlockTime); if (lastRelayedTimestamp != boost::none) node.put("lastRelayedTimestamp", *lastRelayedTimestamp); if (receivedTimestamp != boost::none) node.put("receivedTimestamp", *receivedTimestamp); - if (isDoubleSpend != boost::none) node.put("isDoubleSpend", *isDoubleSpend); + if (isDoubleSpendSeen != boost::none) node.put("isDoubleSpendSeen", *isDoubleSpendSeen); if (key != boost::none) node.put("key", *key); if (fullHex != boost::none) node.put("fullHex", *fullHex); if (prunedHex != boost::none) node.put("prunedHex", *prunedHex); @@ -254,7 +254,7 @@ namespace monero { isConfirmed = MoneroUtils::reconcile(isConfirmed, other->isConfirmed); doNotRelay = MoneroUtils::reconcile(doNotRelay, other->doNotRelay); isRelayed = MoneroUtils::reconcile(isRelayed, other->isRelayed); - isDoubleSpend = MoneroUtils::reconcile(isDoubleSpend, other->isDoubleSpend); + isDoubleSpendSeen = MoneroUtils::reconcile(isDoubleSpendSeen, other->isDoubleSpendSeen); key = MoneroUtils::reconcile(key, other->key); fullHex = MoneroUtils::reconcile(fullHex, other->fullHex); prunedHex = MoneroUtils::reconcile(prunedHex, other->prunedHex); diff --git a/src/daemon/MoneroDaemonModel.h b/src/daemon/MoneroDaemonModel.h index 9bceae1..7abc0cd 100644 --- a/src/daemon/MoneroDaemonModel.h +++ b/src/daemon/MoneroDaemonModel.h @@ -171,7 +171,7 @@ namespace monero { boost::optional unlockTime; boost::optional lastRelayedTimestamp; boost::optional receivedTimestamp; - boost::optional isDoubleSpend; + boost::optional isDoubleSpendSeen; boost::optional key; boost::optional fullHex; boost::optional prunedHex; diff --git a/src/utils/MoneroUtils.cpp b/src/utils/MoneroUtils.cpp index 88aab14..ad8be3f 100644 --- a/src/utils/MoneroUtils.cpp +++ b/src/utils/MoneroUtils.cpp @@ -194,7 +194,7 @@ void nodeToTx(const boost::property_tree::ptree& node, shared_ptr tx) else if (key == string("unlockTime")) throw runtime_error("unlockTime deserialization not implemented"); else if (key == string("lastRelayedTimestamp")) throw runtime_error("lastRelayedTimestamp deserialization not implemented"); else if (key == string("receivedTimestamp")) throw runtime_error("receivedTimestamp deserializationn not implemented"); - else if (key == string("isDoubleSpend")) tx->isDoubleSpend = stringToBool(it->second.data()); + else if (key == string("isDoubleSpendSeen")) tx->isDoubleSpendSeen = stringToBool(it->second.data()); else if (key == string("key")) tx->key = it->second.data(); else if (key == string("fullHex")) tx->fullHex = it->second.data(); else if (key == string("prunedHex")) tx->prunedHex = it->second.data(); diff --git a/src/wallet/MoneroWallet.cpp b/src/wallet/MoneroWallet.cpp index 4aa6686..f3a45ae 100644 --- a/src/wallet/MoneroWallet.cpp +++ b/src/wallet/MoneroWallet.cpp @@ -112,7 +112,7 @@ namespace monero { tx->isRelayed = true; tx->inTxPool = false; tx->doNotRelay = false; - tx->isDoubleSpend = false; + tx->isDoubleSpendSeen = false; // compute numConfirmations TODO monero core: this logic is based on wallet_rpc_server.cpp:87 but it should be encapsulated in wallet2 // TODO: factor out this duplicate code with buildTxWithOutgoingTransfer() @@ -164,7 +164,7 @@ namespace monero { tx->isRelayed = true; tx->inTxPool = false; tx->doNotRelay = false; - tx->isDoubleSpend = false; + tx->isDoubleSpendSeen = false; // compute numConfirmations TODO monero core: this logic is based on wallet_rpc_server.cpp:87 but it should be encapsulated in wallet2 if (*block->height >= height || (*block->height == 0 && !*tx->inTxPool)) tx->numConfirmations = 0; @@ -231,7 +231,7 @@ namespace monero { tx->isRelayed = true; tx->inTxPool = true; tx->doNotRelay = false; - tx->isDoubleSpend = ppd.m_double_spend_seen; + tx->isDoubleSpendSeen = ppd.m_double_spend_seen; tx->numConfirmations = 0; // construct transfer @@ -271,7 +271,7 @@ namespace monero { tx->isRelayed = !tx->isFailed.get(); tx->inTxPool = !tx->isFailed.get(); tx->doNotRelay = false; - if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpend = false; // TODO: test and handle if true + if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpendSeen = false; // TODO: test and handle if true tx->numConfirmations = 0; // construct transfer @@ -330,7 +330,7 @@ namespace monero { tx->isRelayed = true; tx->inTxPool = false; tx->doNotRelay = false; - tx->isDoubleSpend = false; + tx->isDoubleSpendSeen = false; // construct vout shared_ptr vout = shared_ptr(new MoneroOutputWallet()); @@ -1688,7 +1688,7 @@ namespace monero { 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 + if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpendSeen = false; // TODO: test and handle if true tx->numConfirmations = 0; tx->mixin = request.mixin; tx->unlockTime = request.unlockTime == boost::none ? 0 : request.unlockTime.get(); @@ -1798,7 +1798,7 @@ namespace monero { 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 + if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpendSeen = false; // TODO: test and handle if true tx->numConfirmations = 0; tx->mixin = request.mixin; tx->unlockTime = request.unlockTime == boost::none ? 0 : request.unlockTime.get(); @@ -1876,7 +1876,7 @@ namespace monero { tx->doNotRelay = doNotRelay; 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 + if (!tx->isFailed.get() && tx->isRelayed.get()) tx->isDoubleSpendSeen = false; // TODO: test and handle if true tx->numConfirmations = 0; //tx->mixin = request.mixin; // TODO: how to get? tx->unlockTime = 0;