Update the doc for InputWeightPrediction::weight()

Clarify that the returned weight doesn't include txid, index, or
sequence weights.
This commit is contained in:
spacebear 2024-10-03 19:39:40 -04:00
parent 8fd53c8ecf
commit aa1fd5f44c
No known key found for this signature in database
GPG Key ID: C80C3DF529D67F16
1 changed files with 2 additions and 2 deletions

View File

@ -1304,8 +1304,8 @@ impl InputWeightPrediction {
InputWeightPrediction { script_size, witness_size }
}
/// Tallies the total weight added to a transaction by an input with this weight prediction,
/// not counting potential witness flag bytes or the witness count varint.
/// Computes the **signature weight** added to a transaction by an input with this weight prediction,
/// not counting the prevout (txid, index), sequence, potential witness flag bytes or the witness count varint.
pub const fn weight(&self) -> Weight {
Weight::from_wu_usize(self.script_size * 4 + self.witness_size)
}