diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-03-17 17:54:54 +0100 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2016-04-04 09:25:34 +0200 |
commit | 8efed3bc93a15fc715fd4f3cca50f44685872b5e (patch) | |
tree | d25414acbb18118519aab29ae23e6339fc8553ff /src/qt/walletmodel.cpp | |
parent | b35a59179359709df21eb026d35f4124ce90fbd1 (diff) |
[Qt] Support for abandoned/abandoning transactions
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r-- | src/qt/walletmodel.cpp | 15 |
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); +} |