diff options
| author | Jonas Schnelli <[email protected]> | 2016-03-17 17:54:54 +0100 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2016-04-04 09:25:34 +0200 |
| commit | 8efed3bc93a15fc715fd4f3cca50f44685872b5e (patch) | |
| tree | d25414acbb18118519aab29ae23e6339fc8553ff /src/qt/walletmodel.cpp | |
| parent | Merge #7558: [RPC] Add import/removeprunedfunds rpc call (diff) | |
| download | discoin-8efed3bc93a15fc715fd4f3cca50f44685872b5e.tar.xz discoin-8efed3bc93a15fc715fd4f3cca50f44685872b5e.zip | |
[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 cf38c64eb..ce230d6ae 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); +} |