@@ -93,7 +93,7 @@ pub(crate) async fn poll_for_user_input(
93
93
let peer_pubkey_and_ip_addr = words. next ( ) ;
94
94
let channel_value_sat = words. next ( ) ;
95
95
if peer_pubkey_and_ip_addr. is_none ( ) || channel_value_sat. is_none ( ) {
96
- println ! ( "ERROR: openchannel has 2 required arguments: `openchannel pubkey@host:port channel_amt_satoshis` [--public]" ) ;
96
+ println ! ( "ERROR: openchannel has 2 required arguments: `openchannel pubkey@host:port channel_amt_satoshis` [--public] [--with-anchors] " ) ;
97
97
continue ;
98
98
}
99
99
let peer_pubkey_and_ip_addr = peer_pubkey_and_ip_addr. unwrap ( ) ;
@@ -119,20 +119,25 @@ pub(crate) async fn poll_for_user_input(
119
119
continue ;
120
120
} ;
121
121
122
- let announce_channel = match words. next ( ) {
123
- Some ( "--public" ) | Some ( "--public=true" ) => true ,
124
- Some ( "--public=false" ) => false ,
125
- Some ( _) => {
126
- println ! ( "ERROR: invalid `--public` command format. Valid formats: `--public`, `--public=true` `--public=false`" ) ;
127
- continue ;
122
+ let ( mut announce_channel, mut with_anchors) = ( false , false ) ;
123
+ while let Some ( word) = words. next ( ) {
124
+ match word {
125
+ "--public" | "--public=true" => announce_channel = true ,
126
+ "--public=false" => announce_channel = false ,
127
+ "--with-anchors" | "--with-anchors=true" => with_anchors = true ,
128
+ "--with-anchors=false" => with_anchors = false ,
129
+ _ => {
130
+ println ! ( "ERROR: invalid boolean flag format. Valid formats: `--option`, `--option=true` `--option=false`" ) ;
131
+ continue ;
132
+ }
128
133
}
129
- None => false ,
130
- } ;
134
+ }
131
135
132
136
if open_channel (
133
137
pubkey,
134
138
chan_amt_sat. unwrap ( ) ,
135
139
announce_channel,
140
+ with_anchors,
136
141
channel_manager. clone ( ) ,
137
142
)
138
143
. is_ok ( )
@@ -455,7 +460,7 @@ fn help() {
455
460
println ! ( " help\t Shows a list of commands." ) ;
456
461
println ! ( " quit\t Close the application." ) ;
457
462
println ! ( "\n Channels:" ) ;
458
- println ! ( " openchannel pubkey@host:port <amt_satoshis> [--public]" ) ;
463
+ println ! ( " openchannel pubkey@host:port <amt_satoshis> [--public] [--with-anchors] " ) ;
459
464
println ! ( " closechannel <channel_id> <peer_pubkey>" ) ;
460
465
println ! ( " forceclosechannel <channel_id> <peer_pubkey>" ) ;
461
466
println ! ( " listchannels" ) ;
@@ -638,7 +643,7 @@ fn do_disconnect_peer(
638
643
}
639
644
640
645
fn open_channel (
641
- peer_pubkey : PublicKey , channel_amt_sat : u64 , announced_channel : bool ,
646
+ peer_pubkey : PublicKey , channel_amt_sat : u64 , announced_channel : bool , with_anchors : bool ,
642
647
channel_manager : Arc < ChannelManager > ,
643
648
) -> Result < ( ) , ( ) > {
644
649
let config = UserConfig {
@@ -649,6 +654,7 @@ fn open_channel(
649
654
} ,
650
655
channel_handshake_config : ChannelHandshakeConfig {
651
656
announced_channel,
657
+ negotiate_anchors_zero_fee_htlc_tx : with_anchors,
652
658
..Default :: default ( )
653
659
} ,
654
660
..Default :: default ( )
0 commit comments