Skip to content

Commit cfbedb1

Browse files
committed
f add require_confirmed_inputs to accept_channel2
1 parent 724bddd commit cfbedb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/msgs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ pub struct AcceptChannelV2 {
351351
///
352352
/// This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
353353
pub channel_type: Option<ChannelTypeFeatures>,
354+
/// Optionally, a requirement that only confirmed inputs can be added
355+
pub require_confirmed_inputs: Option<()>,
354356
}
355357

356358
/// A [`funding_created`] message to be sent to or received from a peer.
@@ -1565,6 +1567,7 @@ impl_writeable_msg!(AcceptChannelV2, {
15651567
shutdown_scriptpubkey
15661568
}, {
15671569
(1, channel_type, option),
1570+
(2, require_confirmed_inputs, option),
15681571
});
15691572

15701573
impl Writeable for TxAddInput {
@@ -2939,6 +2942,7 @@ mod tests {
29392942
first_per_commitment_point: pubkey_6,
29402943
shutdown_scriptpubkey: if shutdown { OptionalField::Present(Address::p2pkh(&::bitcoin::PublicKey{compressed: true, inner: pubkey_1}, Network::Testnet).script_pubkey()) } else { OptionalField::Absent },
29412944
channel_type: None,
2945+
require_confirmed_inputs: None,
29422946
};
29432947
let encoded_value = accept_channelv2.encode();
29442948
let mut target_value = hex::decode("020202020202020202020202020202020202020202020202020202020202020212345678901234561234567890123456233403289122369800083a840000034d000c89d4c0bcc0bc031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f024d4b6cd1361032ca9bd2aeb9d900aa4d45d9ead80ac9423374c451a7254d076602531fe6068134503d2723133227c867ac8fa6c83c537e9a44c3c5bdbdcb1fe33703462779ad4aad39514614751a71085f2f10e1c7a593e4e030efb5b8721ce55b0b0362c0a046dacce86ddd0343c6d3c7c79c2208ba0d9c9cf24a6d046d21d21f90f703f006a18d5653c4edf5391ff23a61f03ff83d237e880ee61187fa9f379a028e0a").unwrap();

0 commit comments

Comments
 (0)