@@ -2324,7 +2324,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
2324
2324
log_trace ! ( logger, "Initial counterparty tx for channel {} is: txid {} tx {}" ,
2325
2325
log_bytes!( self . channel_id( ) ) , counterparty_initial_bitcoin_tx. txid, encode:: serialize_hex( & counterparty_initial_bitcoin_tx. transaction) ) ;
2326
2326
2327
- let counterparty_signature = self . holder_signer . as_ecdsa ( ) . sign_counterparty_commitment ( & counterparty_initial_commitment_tx, Vec :: new ( ) , & self . secp_ctx )
2327
+ let counterparty_signature = self . holder_signer . as_ecdsa ( ) . unwrap ( ) . sign_counterparty_commitment ( & counterparty_initial_commitment_tx, Vec :: new ( ) , & self . secp_ctx )
2328
2328
. map_err ( |_| ChannelError :: Close ( "Failed to get signatures for new commitment_signed" . to_owned ( ) ) ) ?. 0 ;
2329
2329
2330
2330
// We sign "counterparty" commitment transaction, allowing them to broadcast the tx if they wish.
@@ -3506,7 +3506,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
3506
3506
* self . next_remote_commitment_tx_fee_info_cached . lock ( ) . unwrap ( ) = None ;
3507
3507
}
3508
3508
3509
- self . holder_signer . as_ecdsa ( ) . validate_counterparty_revocation (
3509
+ self . holder_signer . as_ecdsa ( ) . unwrap ( ) . validate_counterparty_revocation (
3510
3510
self . cur_counterparty_commitment_transaction_number + 1 ,
3511
3511
& secret
3512
3512
) . map_err ( |_| ChannelError :: Close ( "Failed to validate revocation from peer" . to_owned ( ) ) ) ?;
@@ -4346,7 +4346,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4346
4346
log_trace ! ( logger, "Proposing initial closing_signed for our counterparty with a fee range of {}-{} sat (with initial proposal {} sats)" ,
4347
4347
our_min_fee, our_max_fee, total_fee_satoshis) ;
4348
4348
4349
- let sig = self . holder_signer . as_ecdsa ( )
4349
+ let sig = self . holder_signer . as_ecdsa ( ) . unwrap ( )
4350
4350
. sign_closing_transaction ( & closing_tx, & self . secp_ctx )
4351
4351
. map_err ( |( ) | ChannelError :: Close ( "Failed to get signature for closing transaction." . to_owned ( ) ) ) ?;
4352
4352
@@ -4556,7 +4556,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4556
4556
self . build_closing_transaction( $new_fee, false )
4557
4557
} ;
4558
4558
4559
- let sig = self . holder_signer. as_ecdsa( )
4559
+ let sig = self . holder_signer. as_ecdsa( ) . unwrap ( )
4560
4560
. sign_closing_transaction( & closing_tx, & self . secp_ctx)
4561
4561
. map_err( |_| ChannelError :: Close ( "External signer refused to sign closing transaction" . to_owned( ) ) ) ?;
4562
4562
@@ -4929,7 +4929,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
4929
4929
#[ cfg( test) ]
4930
4930
pub fn get_signer ( & self ) -> & Signer {
4931
4931
// the Signer parameterization will only ever be used for the ECDSA signer
4932
- self . holder_signer . as_ecdsa ( )
4932
+ self . holder_signer . as_ecdsa ( ) . unwrap ( )
4933
4933
}
4934
4934
4935
4935
#[ cfg( test) ]
@@ -5507,7 +5507,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5507
5507
fn get_outbound_funding_created_signature < L : Deref > ( & mut self , logger : & L ) -> Result < Signature , ChannelError > where L :: Target : Logger {
5508
5508
let counterparty_keys = self . build_remote_transaction_keys ( ) ;
5509
5509
let counterparty_initial_commitment_tx = self . build_commitment_transaction ( self . cur_counterparty_commitment_transaction_number , & counterparty_keys, false , false , logger) . tx ;
5510
- Ok ( self . holder_signer . as_ecdsa ( ) . sign_counterparty_commitment ( & counterparty_initial_commitment_tx, Vec :: new ( ) , & self . secp_ctx )
5510
+ Ok ( self . holder_signer . as_ecdsa ( ) . unwrap ( ) . sign_counterparty_commitment ( & counterparty_initial_commitment_tx, Vec :: new ( ) , & self . secp_ctx )
5511
5511
. map_err ( |_| ChannelError :: Close ( "Failed to get signatures for new commitment_signed" . to_owned ( ) ) ) ?. 0 )
5512
5512
}
5513
5513
@@ -5641,7 +5641,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5641
5641
} ,
5642
5642
Ok ( v) => v
5643
5643
} ;
5644
- let our_bitcoin_sig = match self . holder_signer . as_ecdsa ( ) . sign_channel_announcement_with_funding_key ( & announcement, & self . secp_ctx ) {
5644
+ let our_bitcoin_sig = match self . holder_signer . as_ecdsa ( ) . unwrap ( ) . sign_channel_announcement_with_funding_key ( & announcement, & self . secp_ctx ) {
5645
5645
Err ( _) => {
5646
5646
log_error ! ( logger, "Signer rejected channel_announcement signing. Channel will not be announced!" ) ;
5647
5647
return None ;
@@ -5670,7 +5670,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5670
5670
5671
5671
let our_node_sig = node_signer. sign_gossip_message ( msgs:: UnsignedGossipMessage :: ChannelAnnouncement ( & announcement) )
5672
5672
. map_err ( |_| ChannelError :: Ignore ( "Failed to generate node signature for channel_announcement" . to_owned ( ) ) ) ?;
5673
- let our_bitcoin_sig = self . holder_signer . as_ecdsa ( ) . sign_channel_announcement_with_funding_key ( & announcement, & self . secp_ctx )
5673
+ let our_bitcoin_sig = self . holder_signer . as_ecdsa ( ) . unwrap ( ) . sign_channel_announcement_with_funding_key ( & announcement, & self . secp_ctx )
5674
5674
. map_err ( |_| ChannelError :: Ignore ( "Signer rejected channel_announcement" . to_owned ( ) ) ) ?;
5675
5675
Ok ( msgs:: ChannelAnnouncement {
5676
5676
node_signature_1 : if were_node_one { our_node_sig } else { their_node_sig } ,
@@ -6050,7 +6050,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
6050
6050
htlcs. push ( htlc) ;
6051
6051
}
6052
6052
6053
- let res = self . holder_signer . as_ecdsa ( ) . sign_counterparty_commitment ( & commitment_stats. tx , commitment_stats. preimages , & self . secp_ctx )
6053
+ let res = self . holder_signer . as_ecdsa ( ) . unwrap ( ) . sign_counterparty_commitment ( & commitment_stats. tx , commitment_stats. preimages , & self . secp_ctx )
6054
6054
. map_err ( |_| ChannelError :: Close ( "Failed to get signatures for new commitment_signed" . to_owned ( ) ) ) ?;
6055
6055
signature = res. 0 ;
6056
6056
htlc_signatures = res. 1 ;
@@ -6362,7 +6362,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Writeable for Channel<Signer> {
6362
6362
self . latest_monitor_update_id . write ( writer) ?;
6363
6363
6364
6364
let mut key_data = VecWriter ( Vec :: new ( ) ) ;
6365
- self . holder_signer . as_ecdsa ( ) . write ( & mut key_data) ?;
6365
+ self . holder_signer . as_ecdsa ( ) . unwrap ( ) . write ( & mut key_data) ?;
6366
6366
assert ! ( key_data. 0 . len( ) < core:: usize :: MAX ) ;
6367
6367
assert ! ( key_data. 0 . len( ) < core:: u32 :: MAX as usize ) ;
6368
6368
( key_data. 0 . len ( ) as u32 ) . write ( writer) ?;
0 commit comments