@@ -1151,8 +1151,8 @@ impl Channel {
1151
1151
panic ! ( "Should not have advanced channel commitment tx numbers prior to funding_created" ) ;
1152
1152
}
1153
1153
1154
- let funding_info = OutPoint :: new ( msg. funding_txid , msg. funding_output_index ) ;
1155
- self . channel_monitor . set_funding_info ( funding_info ) ;
1154
+ let funding_txo = OutPoint :: new ( msg. funding_txid , msg. funding_output_index ) ;
1155
+ self . channel_monitor . set_funding_info ( funding_txo ) ;
1156
1156
1157
1157
let ( remote_initial_commitment_tx, our_signature) = match self . funding_created_signature ( & msg. signature ) {
1158
1158
Ok ( res) => res,
@@ -1166,7 +1166,6 @@ impl Channel {
1166
1166
1167
1167
self . channel_monitor . provide_latest_remote_commitment_tx_info ( & remote_initial_commitment_tx, Vec :: new ( ) , self . cur_remote_commitment_transaction_number ) ;
1168
1168
self . channel_state = ChannelState :: FundingSent as u32 ;
1169
- let funding_txo = self . channel_monitor . get_funding_txo ( ) . unwrap ( ) ;
1170
1169
self . channel_id = funding_txo. to_channel_id ( ) ;
1171
1170
self . cur_remote_commitment_transaction_number -= 1 ;
1172
1171
self . cur_local_commitment_transaction_number -= 1 ;
@@ -1930,9 +1929,9 @@ impl Channel {
1930
1929
self . channel_update_count += 1 ;
1931
1930
} else {
1932
1931
self . funding_tx_confirmations = 1 ;
1933
- self . short_channel_id = Some ( ( ( height as u64 ) << ( 5 * 8 ) ) |
1932
+ self . short_channel_id = Some ( ( ( height as u64 ) << ( 5 * 8 ) ) |
1934
1933
( ( * index_in_block as u64 ) << ( 2 * 8 ) ) |
1935
- ( ( self . channel_monitor . get_funding_txo ( ) . unwrap ( ) . index as u64 ) << ( 2 * 8 ) ) ) ;
1934
+ ( ( txo_idx as u64 ) << ( 0 * 8 ) ) ) ;
1936
1935
}
1937
1936
}
1938
1937
}
@@ -2071,7 +2070,6 @@ impl Channel {
2071
2070
// Now that we're past error-generating stuff, update our local state:
2072
2071
self . channel_monitor . provide_latest_remote_commitment_tx_info ( & commitment_tx, Vec :: new ( ) , self . cur_remote_commitment_transaction_number ) ;
2073
2072
self . channel_state = ChannelState :: FundingCreated as u32 ;
2074
- let funding_txo = self . channel_monitor . get_funding_txo ( ) . unwrap ( ) ;
2075
2073
self . channel_id = funding_txo. to_channel_id ( ) ;
2076
2074
self . cur_remote_commitment_transaction_number -= 1 ;
2077
2075
@@ -2332,7 +2330,7 @@ mod tests {
2332
2330
use ln:: channel:: { Channel , ChannelKeys , HTLCOutput , HTLCState , HTLCOutputInCommitment , TxCreationKeys } ;
2333
2331
use ln:: chan_utils;
2334
2332
use chain:: chaininterface:: { FeeEstimator , ConfirmationTarget } ;
2335
- use chain:: transaction:: OutPoint ;
2333
+ use chain:: transaction:: OutPoint ;
2336
2334
use secp256k1:: { Secp256k1 , Message , Signature } ;
2337
2335
use secp256k1:: key:: { SecretKey , PublicKey } ;
2338
2336
use crypto:: sha2:: Sha256 ;
@@ -2868,7 +2866,7 @@ mod tests {
2868
2866
let mut seed = [ 0 ; 32 ] ;
2869
2867
seed[ 0 ..32 ] . clone_from_slice ( & hex_bytes ( "0000000000000000000000000000000000000000000000000000000000000000" ) . unwrap ( ) ) ;
2870
2868
assert_eq ! ( chan_utils:: build_commitment_secret( seed, 281474976710655 ) ,
2871
- hex_bytes( "02a40c85b6f28da08dfdbe0926c53fab2de6d28c10301f8f7c4073d5e42e3148" ) . unwrap( ) [ ..] ) ;
2869
+ hex_bytes( "02a40c85b6f28da08dfdbe0926c53fab2de6d28c10301f8f7c4073d5e42e3148" ) . unwrap( ) [ ..] ) ;
2872
2870
2873
2871
seed[ 0 ..32 ] . clone_from_slice ( & hex_bytes ( "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" ) . unwrap ( ) ) ;
2874
2872
assert_eq ! ( chan_utils:: build_commitment_secret( seed, 281474976710655 ) ,
0 commit comments