Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
wallet::feebumper Namespace Reference

Classes

struct  SignatureWeights
class  SignatureWeightChecker

Enumerations

enum class  Result {
  OK , INVALID_ADDRESS_OR_KEY , INVALID_REQUEST , INVALID_PARAMETER ,
  WALLET_ERROR , MISC_ERROR
}

Functions

bool TransactionCanBeBumped (const CWallet &wallet, const Txid &txid)
 Return whether transaction can be bumped.
Result CreateRateBumpTransaction (CWallet &wallet, const Txid &txid, const CCoinControl &coin_control, std::vector< bilingual_str > &errors, CAmount &old_fee, CAmount &new_fee, CMutableTransaction &mtx, bool require_mine, const std::vector< CTxOut > &outputs, std::optional< uint32_t > original_change_index=std::nullopt)
 Create bumpfee transaction based on feerate estimates.
bool SignTransaction (CWallet &wallet, CMutableTransaction &mtx)
Result CommitTransaction (CWallet &wallet, const Txid &txid, CMutableTransaction &&mtx, std::vector< bilingual_str > &errors, Txid &bumped_txid)
static void CheckMaxWeightComputation (const std::string &script_str, const std::vector< std::string > &witness_str_stack, const std::string &prevout_script_str, int64_t expected_max_weight)
 BOOST_AUTO_TEST_CASE (external_max_weight_test)

Enumeration Type Documentation

◆ Result

enum class wallet::feebumper::Result
strong
Enumerator
OK 
INVALID_ADDRESS_OR_KEY 
INVALID_REQUEST 
INVALID_PARAMETER 
WALLET_ERROR 
MISC_ERROR 

Definition at line 23 of file feebumper.h.

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

wallet::feebumper::BOOST_AUTO_TEST_CASE ( external_max_weight_test )

Definition at line 42 of file feebumper_tests.cpp.

Here is the call graph for this function:

◆ CheckMaxWeightComputation()

void wallet::feebumper::CheckMaxWeightComputation ( const std::string & script_str,
const std::vector< std::string > & witness_str_stack,
const std::string & prevout_script_str,
int64_t expected_max_weight )
static

Definition at line 20 of file feebumper_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommitTransaction()

Result wallet::feebumper::CommitTransaction ( CWallet & wallet,
const Txid & txid,
CMutableTransaction && mtx,
std::vector< bilingual_str > & errors,
Txid & bumped_txid )

Commit the bumpfee transaction.

Returns
success in case of CWallet::CommitTransaction was successful, but sets errors if the tx could not be added to the mempool (will try later) or if the old transaction could not be marked as replaced.

Definition at line 350 of file feebumper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateRateBumpTransaction()

Result wallet::feebumper::CreateRateBumpTransaction ( CWallet & wallet,
const Txid & txid,
const CCoinControl & coin_control,
std::vector< bilingual_str > & errors,
CAmount & old_fee,
CAmount & new_fee,
CMutableTransaction & mtx,
bool require_mine,
const std::vector< CTxOut > & outputs,
std::optional< uint32_t > original_change_index = std::nullopt )

Create bumpfee transaction based on feerate estimates.

Parameters
[in]walletThe wallet to use for this bumping
[in]txidThe txid of the transaction to bump
[in]coin_controlA CCoinControl object which provides feerates and other information used for coin selection
[out]errorsErrors
[out]old_feeThe fee the original transaction pays
[out]new_feethe fee that the bump transaction pays
[out]mtxThe bump transaction itself
[in]require_mineWhether the original transaction must consist of inputs that can be spent by the wallet
[in]outputsVector of new outputs to replace the bumped transaction's outputs
[in]original_change_indexThe position of the change output to deduct the fee from in the transaction being bumped

Definition at line 159 of file feebumper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignTransaction()

bool wallet::feebumper::SignTransaction ( CWallet & wallet,
CMutableTransaction & mtx )

Sign the new transaction,

Returns
false if the tx couldn't be found or if it was impossible to create the signature(s)

Definition at line 330 of file feebumper.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TransactionCanBeBumped()

bool wallet::feebumper::TransactionCanBeBumped ( const CWallet & wallet,
const Txid & txid )

Return whether transaction can be bumped.

Definition at line 148 of file feebumper.cpp.

Here is the call graph for this function: