Merge rust-bitcoin/rust-bitcoin#665: transactions: add a note about `get_vsize` and standardness rules
826fed53f2
transactions: add a note about `get_vsize` and standardness rules (Antoine Poinsot) Pull request description: If they ever hit a discrepancy they must really be doing something dodgy but hey :) ACKs for top commit: dr-orlovsky: ACK826fed53f2
Tree-SHA512: c618a80b047797625a233939d2c1146e8b4ce44215648841813f78178577afc844f5e561e4e60b4084e315735894ecb354af8d81f4702f5354e5d5cd05b52ac4
This commit is contained in:
commit
b945a5e5c6
|
@ -431,6 +431,13 @@ impl Transaction {
|
|||
}
|
||||
|
||||
/// Gets the "vsize" of this transaction. Will be `ceil(weight / 4.0)`.
|
||||
/// Note this implements the virtual size as per [`bip141`], which is different
|
||||
/// to what is implemented in Bitcoin Core. The computation should be the same
|
||||
/// for any remotely sane transaction, and a standardness-rule-correct version
|
||||
/// is available in the [`policy`] module.
|
||||
///
|
||||
/// [`bip141`]: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki
|
||||
/// [`policy`]: ../policy/mod.rs.html
|
||||
#[inline]
|
||||
pub fn get_vsize(&self) -> usize {
|
||||
let weight = self.get_weight();
|
||||
|
|
Loading…
Reference in New Issue