Document the magic bytes for witness commitment
This commit is contained in:
parent
85fa0ce28d
commit
d942882b36
|
@ -245,6 +245,7 @@ impl Block {
|
||||||
|
|
||||||
/// Checks if witness commitment in coinbase matches the transaction list.
|
/// Checks if witness commitment in coinbase matches the transaction list.
|
||||||
pub fn check_witness_commitment(&self) -> bool {
|
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];
|
const MAGIC: [u8; 6] = [0x6a, 0x24, 0xaa, 0x21, 0xa9, 0xed];
|
||||||
// Witness commitment is optional if there are no transactions using SegWit in the block.
|
// 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())) {
|
if self.txdata.iter().all(|t| t.input.iter().all(|i| i.witness.is_empty())) {
|
||||||
|
|
Loading…
Reference in New Issue