1 // Copyright (c) 2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_WALLET_FEEBUMPER_H
6 #define BITCOIN_WALLET_FEEBUMPER_H
8 #include <primitives/transaction.h>
14 enum class FeeEstimateMode
;
16 enum class BumpFeeResult
19 INVALID_ADDRESS_OR_KEY
,
29 CFeeBumper(const CWallet
*pWalletIn
, const uint256 txidIn
, const CCoinControl
& coin_control
, CAmount totalFee
);
30 BumpFeeResult
getResult() const { return currentResult
; }
31 const std::vector
<std::string
>& getErrors() const { return vErrors
; }
32 CAmount
getOldFee() const { return nOldFee
; }
33 CAmount
getNewFee() const { return nNewFee
; }
34 uint256
getBumpedTxId() const { return bumpedTxid
; }
36 /* signs the new transaction,
37 * returns false if the tx couldn't be found or if it was
38 * impossible to create the signature(s)
40 bool signTransaction(CWallet
*pWallet
);
42 /* commits the fee bump,
43 * returns true, in case of CWallet::CommitTransaction was successful
44 * but, eventually sets vErrors if the tx could not be added to the mempool (will try later)
45 * or if the old transaction could not be marked as replaced
47 bool commit(CWallet
*pWalletNonConst
);
50 bool preconditionChecks(const CWallet
*pWallet
, const CWalletTx
& wtx
);
54 CMutableTransaction mtx
;
55 std::vector
<std::string
> vErrors
;
56 BumpFeeResult currentResult
;
61 #endif // BITCOIN_WALLET_FEEBUMPER_H