}
fn help() {
- println!("openchannel pubkey@host:port <channel_amt_satoshis>");
+ println!("openchannel pubkey@host:port <amt_satoshis>");
println!("sendpayment <invoice>");
- println!("getinvoice <amt_in_millisatoshis>");
+ println!("getinvoice <amt_millisatoshis>");
println!("connectpeer pubkey@host:port");
println!("listchannels");
println!("listpayments");
println!("closechannel <channel_id>");
println!("forceclosechannel <channel_id>");
+ println!("nodeinfo");
+ println!("listpeers");
}
fn node_info(channel_manager: Arc<ChannelManager>, peer_manager: Arc<PeerManager>) {
println!("");
println!("\t{{");
println!("\t\tchannel_id: {},", hex_utils::hex_str(&chan_info.channel_id[..]));
+ if let Some(funding_txo) = chan_info.funding_txo {
+ println!("\t\tfunding_txid: {},", funding_txo.txid);
+ }
println!(
"\t\tpeer_pubkey: {},",
hex_utils::hex_str(&chan_info.remote_network_id.serialize())
);
- let mut pending_channel = false;
- match chan_info.short_channel_id {
- Some(id) => println!("\t\tshort_channel_id: {},", id),
- None => {
- pending_channel = true;
- }
+ if let Some(id) = chan_info.short_channel_id {
+ println!("\t\tshort_channel_id: {},", id);
}
- println!("\t\tpending_open: {},", pending_channel);
+ println!("\t\tis_confirmed_onchain: {},", chan_info.is_funding_locked);
println!("\t\tchannel_value_satoshis: {},", chan_info.channel_value_satoshis);
+ if chan_info.is_usable {
+ println!("\t\tavailable_balance_for_send_msat: {},", chan_info.outbound_capacity_msat);
+ println!("\t\tavailable_balance_for_recv_msat: {},", chan_info.inbound_capacity_msat);
+ }
println!("\t\tchannel_can_send_payments: {},", chan_info.is_usable);
+ println!("\t\tpublic: {},", chan_info.is_public);
println!("\t}},");
}
println!("]");
}
// lnd's max to_self_delay is 2016, so we want to be compatible.
config.peer_channel_config_limits.their_to_self_delay = 2016;
- match channel_manager.create_channel(peer_pubkey, channel_amt_sat, 0, 0, None) {
+ match channel_manager.create_channel(peer_pubkey, channel_amt_sat, 0, 0, Some(config)) {
Ok(_) => {
println!("EVENT: initiated channel with peer {}. ", peer_pubkey);
return Ok(());
if peer_addr_str.is_none() || peer_addr_str.is_none() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
- "ERROR: incorrectly formatted peer
- info. Should be formatted as: `pubkey@host:port`",
+ "ERROR: incorrectly formatted peer info. Should be formatted as: `pubkey@host:port`",
));
}