mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
consensus/validation.h: remove needless GetTransactionOutputWeight helper
Introduced in 9b7ec393b8
. This copied the format of the other Get.*Weight helpers but it's useless for a CTxOut.
This commit is contained in:
parent
d2ccca253f
commit
8d6228fc1f
2 changed files with 1 additions and 5 deletions
|
@ -158,10 +158,6 @@ static inline int64_t GetTransactionInputWeight(const CTxIn& txin)
|
|||
// scriptWitness size is added here because witnesses and txins are split up in segwit serialization.
|
||||
return ::GetSerializeSize(txin, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(txin, PROTOCOL_VERSION) + ::GetSerializeSize(txin.scriptWitness.stack, PROTOCOL_VERSION);
|
||||
}
|
||||
static inline int64_t GetTransactionOutputWeight(const CTxOut& txout)
|
||||
{
|
||||
return ::GetSerializeSize(txout, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(txout, PROTOCOL_VERSION);
|
||||
}
|
||||
|
||||
/** Compute at which vout of the block's coinbase transaction the witness commitment occurs, or -1 if not found */
|
||||
inline int GetWitnessCommitmentIndex(const CBlock& block)
|
||||
|
|
|
@ -144,7 +144,7 @@ TxSize CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *walle
|
|||
if (is_segwit) weight += 2;
|
||||
|
||||
// Add the size of the transaction outputs.
|
||||
for (const auto& txo : tx.vout) weight += GetTransactionOutputWeight(txo);
|
||||
for (const auto& txo : tx.vout) weight += GetSerializeSize(txo) * WITNESS_SCALE_FACTOR;
|
||||
|
||||
// Add the size of the transaction inputs as if they were signed.
|
||||
for (uint32_t i = 0; i < txouts.size(); i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue