aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-04-14 16:32:41 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-04-14 16:35:02 +0200
commit430fffefaab6832b8f6605f14a992e7e55b9547e (patch)
tree29891580b73e5c4c7749e5c129220c3a98752006 /src/wallet
parentd97101e5a84bd6abf62a7c9124b27b145fac6ca1 (diff)
parent4f7c959af1672f9f51122867dca48ac4fa454d75 (diff)
downloadbitcoin-430fffefaab6832b8f6605f14a992e7e55b9547e.tar.xz
Merge #7812: Tiny refactor of `IsRBFOptIn`, avoid exception
4f7c959 Refactor IsRBFOptIn, avoid exception (Jonas Schnelli)
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/rpcwallet.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 61c9846e11..5511e9d3ab 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -82,15 +82,11 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
std::string rbfStatus = "no";
if (confirms <= 0) {
LOCK(mempool.cs);
- if (!mempool.exists(hash)) {
- if (SignalsOptInRBF(wtx)) {
- rbfStatus = "yes";
- } else {
- rbfStatus = "unknown";
- }
- } else if (IsRBFOptIn(*mempool.mapTx.find(hash), mempool)) {
+ RBFTransactionState rbfState = IsRBFOptIn(wtx, mempool);
+ if (rbfState == RBF_TRANSACTIONSTATE_UNKNOWN)
+ rbfStatus = "unknown";
+ else if (rbfState == RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125)
rbfStatus = "yes";
- }
}
entry.push_back(Pair("bip125-replaceable", rbfStatus));