mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
[Qt] Support for abandoned/abandoning transactions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user