X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannelmanager.rs;h=d0df159e22bb25b5fd96eed2273220f328557535;hb=df88525d44563e44201bbfd745ffc57614f14c30;hp=8bc5bf88d9a9e8ba0e7241e5555fd574beb91932;hpb=4cb059e7b996821e493ed3c61b00ae4d8bb6879e;p=rust-lightning diff --git a/src/ln/channelmanager.rs b/src/ln/channelmanager.rs index 8bc5bf88..d0df159e 100644 --- a/src/ln/channelmanager.rs +++ b/src/ln/channelmanager.rs @@ -449,7 +449,10 @@ impl ChannelManager { let channel_state = self.channel_state.lock().unwrap(); let mut res = Vec::with_capacity(channel_state.by_id.len()); for (channel_id, channel) in channel_state.by_id.iter() { - if channel.is_usable() { + // Note we use is_live here instead of usable which leads to somewhat confused + // internal/external nomenclature, but that's ok cause that's probably what the user + // really wanted anyway. + if channel.is_live() { res.push(ChannelDetails { channel_id: (*channel_id).clone(), short_channel_id: channel.get_short_channel_id(), @@ -997,7 +1000,7 @@ impl ChannelManager { }; let msg_hash = Sha256dHash::from_data(&unsigned.encode()[..]); - let sig = self.secp_ctx.sign(&Message::from_slice(&msg_hash[..]).unwrap(), &self.our_network_key); //TODO Can we unwrap here? + let sig = self.secp_ctx.sign(&Message::from_slice(&msg_hash[..]).unwrap(), &self.our_network_key); Ok(msgs::ChannelUpdate { signature: sig, @@ -1102,7 +1105,6 @@ impl ChannelManager { /// May panic if the funding_txo is duplicative with some other channel (note that this should /// be trivially prevented by using unique funding transaction keys per-channel). pub fn funding_transaction_generated(&self, temporary_channel_id: &[u8; 32], funding_txo: OutPoint) { - macro_rules! add_pending_event { ($event: expr) => { { @@ -1998,7 +2000,7 @@ impl ChannelManager { match channel_state.by_id.get_mut(&channel_id) { None => return Err(APIError::APIMisuseError{err: "Failed to find corresponding channel"}), Some(chan) => { - if !chan.is_usable() { + if !chan.is_live() { return Err(APIError::APIMisuseError{err: "Channel is not in usuable state"}); } if !chan.is_outbound() {