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
;
21 INVALID_ADDRESS_OR_KEY
,
28 //! Return whether transaction can be bumped.
29 bool TransactionCanBeBumped(CWallet
* wallet
, const uint256
& txid
);
31 //! Create bumpfee transaction.
32 Result
CreateTransaction(const CWallet
* wallet
,
34 const CCoinControl
& coin_control
,
36 std::vector
<std::string
>& errors
,
39 CMutableTransaction
& mtx
);
41 //! Sign the new transaction,
42 //! @return false if the tx couldn't be found or if it was
43 //! impossible to create the signature(s)
44 bool SignTransaction(CWallet
* wallet
, CMutableTransaction
& mtx
);
46 //! Commit the bumpfee transaction.
47 //! @return success in case of CWallet::CommitTransaction was successful,
48 //! but sets errors if the tx could not be added to the mempool (will try later)
49 //! or if the old transaction could not be marked as replaced.
50 Result
CommitTransaction(CWallet
* wallet
,
52 CMutableTransaction
&& mtx
,
53 std::vector
<std::string
>& errors
,
54 uint256
& bumped_txid
);
56 } // namespace feebumper
58 #endif // BITCOIN_WALLET_FEEBUMPER_H