Merge 9c30f5ef9d into merged_master (Bitcoin PR bitcoin-core/gui#766)

This commit is contained in:
Byron Hambly 2025-08-07 13:30:43 +02:00
commit 17c0b77652
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697

View file

@ -421,7 +421,19 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
std::vector<unsigned char> witnessprogram;
if (out.txout.scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram))
{
nBytesInputs += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);
// add input skeleton bytes (outpoint, scriptSig size, nSequence)
nBytesInputs += (32 + 4 + 1 + 4);
if (witnessversion == 0) { // P2WPKH
// 1 WU (witness item count) + 72 WU (ECDSA signature with len byte) + 34 WU (pubkey with len byte)
nBytesInputs += 107 / WITNESS_SCALE_FACTOR;
} else if (witnessversion == 1) { // P2TR key-path spend
// 1 WU (witness item count) + 65 WU (Schnorr signature with len byte)
nBytesInputs += 66 / WITNESS_SCALE_FACTOR;
} else {
// not supported, should be unreachable
throw std::runtime_error("Trying to spend future segwit version script");
}
fWitness = true;
}
else if(ExtractDestination(out.txout.scriptPubKey, address))