Skip to content

Commit 74c11a8

Browse files
committed
Assert in tests that the witness spending a P2A anchor is empty
1 parent bb3eeed commit 74c11a8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5831,6 +5831,8 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
58315831
assert_eq!(&bitcoin::Address::p2wsh(&ScriptBuf::from(input.witness.last().unwrap().to_vec()), bitcoin::Network::Bitcoin).script_pubkey(), _script_pubkey);
58325832
} else if _script_pubkey.is_p2wpkh() {
58335833
assert_eq!(&bitcoin::Address::p2wpkh(&bitcoin::CompressedPublicKey(bitcoin::PublicKey::from_slice(&input.witness.last().unwrap()).unwrap().inner), bitcoin::Network::Bitcoin).script_pubkey(), _script_pubkey);
5834+
} else if _script_pubkey == &chan_utils::shared_anchor_script_pubkey() {
5835+
assert!(input.witness.is_empty());
58345836
} else { panic!(); }
58355837
}
58365838
return true;

0 commit comments

Comments
 (0)