X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannel.rs;h=c4b6acb7d632708c322b15915cf2bdc240cdead9;hb=4e4fa56e2b52971271ccddf56e8195d96b1c69ba;hp=f80b516492fb7cd1d6a9db670c7a9fe8669d3d21;hpb=84e45f477b4b0daa4a2acdeda05817d79c673b60;p=rust-lightning diff --git a/src/ln/channel.rs b/src/ln/channel.rs index f80b5164..c4b6acb7 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -570,7 +570,7 @@ impl Channel { &PublicKey::from_secret_key(&secp_ctx, &chan_keys.delayed_payment_base_key), &chan_keys.htlc_base_key, BREAKDOWN_TIMEOUT, our_channel_monitor_claim_script); - channel_monitor.set_their_htlc_base_key(&msg.htlc_basepoint); + channel_monitor.set_their_base_keys(&msg.htlc_basepoint, &msg.delayed_payment_basepoint); channel_monitor.set_their_to_self_delay(msg.to_self_delay); let mut chan = Channel { @@ -1236,7 +1236,7 @@ impl Channel { // max_accepted_htlcs too small // dust_limit_satoshis too small - self.channel_monitor.set_their_htlc_base_key(&msg.htlc_basepoint); + self.channel_monitor.set_their_base_keys(&msg.htlc_basepoint, &msg.delayed_payment_basepoint); self.their_dust_limit_satoshis = msg.dust_limit_satoshis; self.their_max_htlc_value_in_flight_msat = cmp::min(msg.max_htlc_value_in_flight_msat, self.channel_value_satoshis * 1000); @@ -2168,7 +2168,7 @@ impl Channel { // Methods to get unprompted messages to send to the remote end (or where we already returned // something in the handler for the message that prompted this message): - pub fn get_open_channel(&self, chain_hash: Sha256dHash, fee_estimator: &FeeEstimator) -> Result { + pub fn get_open_channel(&self, chain_hash: Sha256dHash, fee_estimator: &FeeEstimator) -> msgs::OpenChannel { if !self.channel_outbound { panic!("Tried to open a channel for an inbound channel?"); } @@ -2182,7 +2182,7 @@ impl Channel { let local_commitment_secret = self.build_local_commitment_secret(self.cur_local_commitment_transaction_number); - Ok(msgs::OpenChannel { + msgs::OpenChannel { chain_hash: chain_hash, temporary_channel_id: self.channel_id, funding_satoshis: self.channel_value_satoshis, @@ -2202,7 +2202,7 @@ impl Channel { first_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &local_commitment_secret), channel_flags: if self.announce_publicly {1} else {0}, shutdown_scriptpubkey: None, - }) + } } pub fn get_accept_channel(&self) -> msgs::AcceptChannel { @@ -2551,10 +2551,7 @@ impl Channel { } } - for htlc in self.pending_outbound_htlcs.drain(..) { - if htlc.state == OutboundHTLCState::LocalAnnounced { - dropped_outbound_htlcs.push((htlc.source, htlc.payment_hash)); - } + for _htlc in self.pending_outbound_htlcs.drain(..) { //TODO: Do something with the remaining HTLCs //(we need to have the ChannelManager monitor them so we can claim the inbound HTLCs //which correspond)