aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-04-04 09:58:24 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-04-04 09:58:33 +0200
commita9149688f87cb790a600400abd9af72c3ee0c312 (patch)
treec3fbf2c496828a7361b7b690fb54079a9d75f476 /src/qt/walletmodel.cpp
parente662a76288011fe6a640f1c02c2381284ad93a03 (diff)
parent8efed3bc93a15fc715fd4f3cca50f44685872b5e (diff)
Merge #7707: [RPC][QT] UI support for abandoned transactions
8efed3b [Qt] Support for abandoned/abandoning transactions (Jonas Schnelli)
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index cf38c64eb0..ce230d6aed 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -668,3 +668,18 @@ bool WalletModel::saveReceiveRequest(const std::string &sAddress, const int64_t
else
return wallet->AddDestData(dest, key, sRequest);
}
+
+bool WalletModel::transactionCanBeAbandoned(uint256 hash) const
+{
+ LOCK2(cs_main, wallet->cs_wallet);
+ const CWalletTx *wtx = wallet->GetWalletTx(hash);
+ if (!wtx || wtx->isAbandoned() || wtx->GetDepthInMainChain() > 0 || wtx->InMempool())
+ return false;
+ return true;
+}
+
+bool WalletModel::abandonTransaction(uint256 hash) const
+{
+ LOCK2(cs_main, wallet->cs_wallet);
+ return wallet->AbandonTransaction(hash);
+}