You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let obscured_commitment_transaction_number = self.get_commitment_transaction_number_obscure_factor() ^ (0xffffffffffff - commitment_number);
698
+
let obscured_commitment_transaction_number = self.get_commitment_transaction_number_obscure_factor() ^ (INITIAL_COMMITMENT_NUMBER - commitment_number);
697
699
698
700
let txins = {
699
701
letmut ins:Vec<TxIn> = Vec::new();
@@ -1303,7 +1305,9 @@ impl Channel {
1303
1305
// channel.
1304
1306
returnErr(HandleError{err:"Received funding_created after we got the channel!",action:Some(msgs::ErrorAction::SendErrorMessage{msg: msgs::ErrorMessage{channel_id:self.channel_id,data:"Received funding_created after we got the channel!".to_string()}})});
returnErr(HandleError{err:"Peer sent a reconnect funding_locked with a different point",action:None});
1382
1389
}
@@ -1908,8 +1915,8 @@ impl Channel {
1908
1915
returnErr(HandleError{err:"Peer sent a loose channel_reestablish not after reconnect",action:Some(msgs::ErrorAction::SendErrorMessage{msg: msgs::ErrorMessage{data:"Peer sent a loose channel_reestablish not after reconnect".to_string(),channel_id: msg.channel_id}})});
1909
1916
}
1910
1917
1911
-
if msg.next_local_commitment_number == 0 || msg.next_local_commitment_number >= 0xffffffffffff ||
let next_per_commitment_point = PublicKey::from_secret_key(&self.secp_ctx,&self.build_local_commitment_secret(self.cur_local_commitment_transaction_number));
1924
1933
let per_commitment_secret = chan_utils::build_commitment_secret(self.local_keys.commitment_seed,self.cur_local_commitment_transaction_number + 2);
1925
1934
required_revoke = Some(msgs::RevokeAndACK{
@@ -1931,8 +1940,8 @@ impl Channel {
1931
1940
returnErr(HandleError{err:"Peer attempted to reestablish channel with a very old local commitment transaction",action:Some(msgs::ErrorAction::SendErrorMessage{msg: msgs::ErrorMessage{data:"Peer attempted to reestablish channel with a very old remote commitment transaction".to_string(),channel_id: msg.channel_id}})});
1932
1941
}
1933
1942
1934
-
if msg.next_local_commitment_number == 0xffffffffffff - self.cur_remote_commitment_transaction_number{
1935
-
if msg.next_remote_commitment_number == 0xffffffffffff - self.cur_local_commitment_transaction_number{
1943
+
if msg.next_local_commitment_number == INITIAL_COMMITMENT_NUMBER - self.cur_remote_commitment_transaction_number{
1944
+
if msg.next_remote_commitment_number == INITIAL_COMMITMENT_NUMBER - self.cur_local_commitment_transaction_number{
1936
1945
log_debug!(self,"Reconnected channel {} with no lost commitment txn", log_bytes!(self.channel_id()));
1937
1946
if msg.next_local_commitment_number == 1 && msg.next_remote_commitment_number == 1{
1938
1947
let next_per_commitment_secret = self.build_local_commitment_secret(self.cur_local_commitment_transaction_number);
panic!("Tried to get a funding_created messsage at a time other than immediately after initial handshake completion (or tried to get funding_created twice)");
let their_signature = Signature::from_der(&secp_ctx,&hex::decode($their_sig_hex).unwrap()[..]).unwrap();
2915
2926
let sighash = Message::from_slice(&bip143::SighashComponents::new(&unsigned_tx.0).sighash_all(&unsigned_tx.0.input[0],&chan.get_funding_redeemscript(), chan.channel_value_satoshis)[..]).unwrap();
0 commit comments