mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
partial Merge #8456: [RPC] Simplified bumpfee command.
It includes only this commit for sake of backporting HasWalletSpent [RPC] bumpfee This command allows a user to increase the fee on a wallet transaction T, creating a "bumper" transaction B. T must signal that it is BIP-125 replaceable. T's change output is decremented to pay the additional fee. (B will not add inputs to T.) T cannot have any descendant transactions. Once B bumps T, neither T nor B's outputs can be spent until either T or (more likely) B is mined. Includes code by @jonasschnelli and @ryanofsky
This commit is contained in:
parent
b64081bf3d
commit
21e1a4a881
@ -495,6 +495,13 @@ std::set<uint256> CWallet::GetConflicts(const uint256& txid) const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CWallet::HasWalletSpend(const uint256& txid) const
|
||||
{
|
||||
AssertLockHeld(cs_wallet);
|
||||
auto iter = mapTxSpends.lower_bound(COutPoint(txid, 0));
|
||||
return (iter != mapTxSpends.end() && iter->first.hash == txid);
|
||||
}
|
||||
|
||||
void CWallet::Flush()
|
||||
{
|
||||
GetDatabase().Flush();
|
||||
|
@ -1190,6 +1190,9 @@ public:
|
||||
//! Get wallet transactions that conflict with given transaction (spend same outputs)
|
||||
std::set<uint256> GetConflicts(const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
|
||||
|
||||
//! Check if a given transaction has any of its outputs spent by another transaction in the wallet
|
||||
bool HasWalletSpend(const uint256& txid) const;
|
||||
|
||||
//! Flush wallet (bitdb flush)
|
||||
void Flush();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user