Merge rust-bitcoin/rust-bitcoin#3370: Document the magic bytes for witness commitment
d942882b36
Document the magic bytes for witness commitment (Peter Ryszkiewicz) Pull request description: ACKs for top commit: apoelstra: ACKd942882b36
successfully ran local tests; neat! I don't think I was aware of this tcharding: ACKd942882b36
Tree-SHA512: 89766e986574e49b6c5fd00844db679eb8894a591463029f7f88079fa9ca65bd56265a42dd8fa5aad20ef4744bca3259c06f8a461abd1c695fb89433ed5cc145
This commit is contained in:
commit
1319c65506
|
@ -245,6 +245,7 @@ impl Block {
|
|||
|
||||
/// Checks if witness commitment in coinbase matches the transaction list.
|
||||
pub fn check_witness_commitment(&self) -> bool {
|
||||
// Consists of OP_RETURN, OP_PUSHBYTES_36, and four "witness header" bytes.
|
||||
const MAGIC: [u8; 6] = [0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed];
|
||||
// Witness commitment is optional if there are no transactions using SegWit in the block.
|
||||
if self.txdata.iter().all(|t| t.input.iter().all(|i| i.witness.is_empty())) {
|
||||
|
|
Loading…
Reference in New Issue