diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index c5597fde..ee2ff518 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -122,7 +122,6 @@ impl fmt::Debug for Header { .field("merkle_root", &self.merkle_root) .field("time", &self.time) .field("bits", &self.bits) - .field("bits", &self.bits) .field("stake_modifier", &self.stake_modifier) .field("deprecated_height", &self.deprecated_height) .field("minted_blocks", &self.minted_blocks) diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs index 54c7b9b7..841777ff 100644 --- a/bitcoin/src/blockdata/transaction.rs +++ b/bitcoin/src/blockdata/transaction.rs @@ -1102,7 +1102,7 @@ impl Encodable for Transaction { len += SEGWIT_FLAG.consensus_encode(w)?; len += self.input.consensus_encode(w)?; - len += if self.version == Version::TWO { + len += if self.version.is_standard() { self.output.iter().try_fold(0usize, |acc, tx| { let value_len = tx.value.consensus_encode(w)?; let script_len = tx.script_pubkey.consensus_encode(w)?; @@ -1134,7 +1134,7 @@ impl Decodable for Transaction { // BIP144 input witnesses 1 => { let mut input = Vec::::consensus_decode_from_finite_reader(r)?; - let output = if version == Version::TWO { + let output = if version.is_standard() { Vec::::consensus_decode_from_finite_reader(r)? .into_iter() .map(Into::into) @@ -1165,7 +1165,7 @@ impl Decodable for Transaction { version, input, output: { - if version == Version::TWO { + if version.is_standard() { Vec::::consensus_decode_from_finite_reader(r)? .into_iter() .map(Into::into)