Merge pull request #33 from jeandudey/funding_txo
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Fri, 29 Jun 2018 21:23:34 +0000 (17:23 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Jun 2018 21:23:34 +0000 (17:23 -0400)
Use the `TxOutRef` type for the `ChannelMonitor`'s funding_txo field.

1  2 
src/ln/channel.rs
src/ln/channelmonitor.rs

index 0d4f1c6c57b5ac3c66f832bcecef36f95cc67f0e,0b951888e6a796a811ff167f95ba2084256d76c3..1c17cb1f9c1f18613a7fe1625119a9c4a91a26ba
@@@ -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;
  
                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 {
Simple merge