@@ -1529,7 +1529,7 @@ impl<Signer: Sign> Channel<Signer> {
1529
1529
& self . get_counterparty_pubkeys ( ) . funding_pubkey
1530
1530
}
1531
1531
1532
- pub fn funding_created < L : Deref > ( & mut self , msg : & msgs:: FundingCreated , last_block_hash : BlockHash , logger : & L ) -> Result < ( msgs:: FundingSigned , ChannelMonitor < Signer > ) , ChannelError > where L :: Target : Logger {
1532
+ pub fn funding_created < L : Deref > ( & mut self , msg : & msgs:: FundingCreated , last_block_hash : BlockHash , last_block_height : u32 , logger : & L ) -> Result < ( msgs:: FundingSigned , ChannelMonitor < Signer > ) , ChannelError > where L :: Target : Logger {
1533
1533
if self . is_outbound ( ) {
1534
1534
return Err ( ChannelError :: Close ( "Received funding_created for an outbound channel?" . to_owned ( ) ) ) ;
1535
1535
}
@@ -1583,7 +1583,7 @@ impl<Signer: Sign> Channel<Signer> {
1583
1583
& self . channel_transaction_parameters ,
1584
1584
funding_redeemscript. clone ( ) , self . channel_value_satoshis ,
1585
1585
obscure_factor,
1586
- holder_commitment_tx, last_block_hash) ;
1586
+ holder_commitment_tx, last_block_hash, last_block_height ) ;
1587
1587
1588
1588
channel_monitor. provide_latest_counterparty_commitment_tx ( counterparty_initial_commitment_txid, Vec :: new ( ) , self . cur_counterparty_commitment_transaction_number , self . counterparty_cur_commitment_point . unwrap ( ) , logger) ;
1589
1589
@@ -1600,7 +1600,7 @@ impl<Signer: Sign> Channel<Signer> {
1600
1600
1601
1601
/// Handles a funding_signed message from the remote end.
1602
1602
/// If this call is successful, broadcast the funding transaction (and not before!)
1603
- pub fn funding_signed < L : Deref > ( & mut self , msg : & msgs:: FundingSigned , last_block_hash : BlockHash , logger : & L ) -> Result < ChannelMonitor < Signer > , ChannelError > where L :: Target : Logger {
1603
+ pub fn funding_signed < L : Deref > ( & mut self , msg : & msgs:: FundingSigned , last_block_hash : BlockHash , last_block_height : u32 , logger : & L ) -> Result < ChannelMonitor < Signer > , ChannelError > where L :: Target : Logger {
1604
1604
if !self . is_outbound ( ) {
1605
1605
return Err ( ChannelError :: Close ( "Received funding_signed for an inbound channel?" . to_owned ( ) ) ) ;
1606
1606
}
@@ -1653,7 +1653,7 @@ impl<Signer: Sign> Channel<Signer> {
1653
1653
& self . channel_transaction_parameters ,
1654
1654
funding_redeemscript. clone ( ) , self . channel_value_satoshis ,
1655
1655
obscure_factor,
1656
- holder_commitment_tx, last_block_hash) ;
1656
+ holder_commitment_tx, last_block_hash, last_block_height ) ;
1657
1657
1658
1658
channel_monitor. provide_latest_counterparty_commitment_tx ( counterparty_initial_bitcoin_tx. txid , Vec :: new ( ) , self . cur_counterparty_commitment_transaction_number , self . counterparty_cur_commitment_point . unwrap ( ) , logger) ;
1659
1659
@@ -5006,6 +5006,7 @@ mod tests {
5006
5006
let network = Network :: Testnet ;
5007
5007
let chain_hash = genesis_block ( network) . header . block_hash ( ) ;
5008
5008
let last_block_hash = chain_hash;
5009
+ let last_block_height = 0 ;
5009
5010
let keys_provider = test_utils:: TestKeysInterface :: new ( & seed, network) ;
5010
5011
5011
5012
// Go through the flow of opening a channel between two nodes.
@@ -5031,10 +5032,10 @@ mod tests {
5031
5032
} ] } ;
5032
5033
let funding_outpoint = OutPoint { txid : tx. txid ( ) , index : 0 } ;
5033
5034
let funding_created_msg = node_a_chan. get_outbound_funding_created ( funding_outpoint, & & logger) . unwrap ( ) ;
5034
- let ( funding_signed_msg, _) = node_b_chan. funding_created ( & funding_created_msg, last_block_hash, & & logger) . unwrap ( ) ;
5035
+ let ( funding_signed_msg, _) = node_b_chan. funding_created ( & funding_created_msg, last_block_hash, last_block_height , & & logger) . unwrap ( ) ;
5035
5036
5036
5037
// Node B --> Node A: funding signed
5037
- let _ = node_a_chan. funding_signed ( & funding_signed_msg, last_block_hash, & & logger) ;
5038
+ let _ = node_a_chan. funding_signed ( & funding_signed_msg, last_block_hash, last_block_height , & & logger) ;
5038
5039
5039
5040
// Now disconnect the two nodes and check that the commitment point in
5040
5041
// Node B's channel_reestablish message is sane.
0 commit comments