test: fix wallet_bumpfee.py

This commit is contained in:
Byron Hambly 2025-10-07 14:01:25 +02:00
parent 282d7bf9b6
commit 0865bc218a
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
5 changed files with 24 additions and 28 deletions

View file

@ -1789,13 +1789,18 @@ bool FillInputToWeight(CMutableTransaction& mtx, size_t nIn, int64_t target_weig
bool CWallet::DummySignTx(CMutableTransaction &txNew, const std::vector<CTxOut> &txouts, const CCoinControl* coin_control) const
{
// Fill in dummy signatures for fee calculation.
int nIn = 0;
size_t nIn = 0;
const bool can_grind_r = CanGrindR();
for (const auto& txout : txouts)
{
CTxIn& txin = txNew.vin[nIn];
// If weight was provided, fill the input to that weight
if (coin_control && coin_control->HasInputWeight(txin.prevout)) {
// ELEMENTS: ensure input witness is large enough for rare case in bumpfee
if (txNew.witness.vtxinwit.size() <= nIn) {
txNew.witness.vtxinwit.resize(nIn + 1);
}
assert(txNew.witness.vtxinwit.size() > nIn);
if (!FillInputToWeight(txNew, nIn, coin_control->GetInputWeight(txin.prevout))) {
return false;
}