From: Matt Corallo <649246+TheBlueMatt@users.noreply.github.com> Date: Fri, 29 Jun 2018 21:23:34 +0000 (-0400) Subject: Merge pull request #33 from jeandudey/funding_txo X-Git-Tag: v0.0.12~400 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=b65aa86ea077fd9d5e0aa46c3d3a0f09ae9bf451;p=rust-lightning Merge pull request #33 from jeandudey/funding_txo Use the `TxOutRef` type for the `ChannelMonitor`'s funding_txo field. --- b65aa86ea077fd9d5e0aa46c3d3a0f09ae9bf451 diff --cc src/ln/channel.rs index 0d4f1c6c5,0b951888e..1c17cb1f9 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@@ -1162,10 -1164,10 +1164,10 @@@ impl Channel // Now that we're past error-generating stuff, update our local state: - self.channel_monitor.provide_latest_remote_commitment_tx_info(&remote_initial_commitment_tx, Vec::new()); + self.channel_monitor.provide_latest_remote_commitment_tx_info(&remote_initial_commitment_tx, Vec::new(), self.cur_remote_commitment_transaction_number); self.channel_state = ChannelState::FundingSent as u32; let funding_txo = self.channel_monitor.get_funding_txo().unwrap(); - self.channel_id = funding_txo.0.into_be() ^ Uint256::from_u64(funding_txo.1 as u64).unwrap(); //TODO: or le? + self.channel_id = funding_txo.to_channel_id(); self.cur_remote_commitment_transaction_number -= 1; self.cur_local_commitment_transaction_number -= 1; @@@ -2067,10 -2069,10 +2069,10 @@@ let temporary_channel_id = self.channel_id; // Now that we're past error-generating stuff, update our local state: - self.channel_monitor.provide_latest_remote_commitment_tx_info(&commitment_tx, Vec::new()); + self.channel_monitor.provide_latest_remote_commitment_tx_info(&commitment_tx, Vec::new(), self.cur_remote_commitment_transaction_number); self.channel_state = ChannelState::FundingCreated as u32; let funding_txo = self.channel_monitor.get_funding_txo().unwrap(); - self.channel_id = funding_txo.0.into_be() ^ Uint256::from_u64(funding_txo.1 as u64).unwrap(); //TODO: or le? + self.channel_id = funding_txo.to_channel_id(); self.cur_remote_commitment_transaction_number -= 1; Ok((msgs::FundingCreated {