@@ -603,7 +603,7 @@ where
603
603
/// Handles a [`BumpTransactionEvent::ChannelClose`] event variant by producing a fully-signed
604
604
/// transaction spending an anchor output of the commitment transaction to bump its fee and
605
605
/// broadcasts them to the network as a package.
606
- fn handle_channel_close (
606
+ async fn handle_channel_close (
607
607
& self , claim_id : ClaimId , package_target_feerate_sat_per_1000_weight : u32 ,
608
608
commitment_tx : & Transaction , commitment_tx_fee_sat : u64 , anchor_descriptor : & AnchorDescriptor ,
609
609
) -> Result < ( ) , ( ) > {
@@ -714,7 +714,7 @@ where
714
714
715
715
/// Handles a [`BumpTransactionEvent::HTLCResolution`] event variant by producing a
716
716
/// fully-signed, fee-bumped HTLC transaction that is broadcast to the network.
717
- fn handle_htlc_resolution (
717
+ async fn handle_htlc_resolution (
718
718
& self , claim_id : ClaimId , target_feerate_sat_per_1000_weight : u32 ,
719
719
htlc_descriptors : & [ HTLCDescriptor ] , tx_lock_time : LockTime ,
720
720
) -> Result < ( ) , ( ) > {
@@ -818,7 +818,7 @@ where
818
818
}
819
819
820
820
/// Handles all variants of [`BumpTransactionEvent`].
821
- pub fn handle_event ( & self , event : & BumpTransactionEvent ) {
821
+ pub async fn handle_event ( & self , event : & BumpTransactionEvent ) {
822
822
match event {
823
823
BumpTransactionEvent :: ChannelClose {
824
824
claim_id, package_target_feerate_sat_per_1000_weight, commitment_tx,
@@ -829,7 +829,7 @@ where
829
829
if let Err ( _) = self . handle_channel_close (
830
830
* claim_id, * package_target_feerate_sat_per_1000_weight, commitment_tx,
831
831
* commitment_tx_fee_satoshis, anchor_descriptor,
832
- ) {
832
+ ) . await {
833
833
log_error ! ( self . logger, "Failed bumping commitment transaction fee for {}" ,
834
834
commitment_tx. compute_txid( ) ) ;
835
835
}
@@ -841,7 +841,7 @@ where
841
841
log_bytes!( claim_id. 0 ) , log_iter!( htlc_descriptors. iter( ) . map( |d| d. outpoint( ) ) ) ) ;
842
842
if let Err ( _) = self . handle_htlc_resolution (
843
843
* claim_id, * target_feerate_sat_per_1000_weight, htlc_descriptors, * tx_lock_time,
844
- ) {
844
+ ) . await {
845
845
log_error ! ( self . logger, "Failed bumping HTLC transaction fee for commitment {}" ,
846
846
htlc_descriptors[ 0 ] . commitment_txid) ;
847
847
}
@@ -903,8 +903,8 @@ mod tests {
903
903
}
904
904
}
905
905
906
- #[ test]
907
- fn test_op_return_under_funds ( ) {
906
+ #[ tokio :: test]
907
+ async fn test_op_return_under_funds ( ) {
908
908
// Test what happens if we have to select coins but the anchor output value itself suffices
909
909
// to pay the required fee.
910
910
//
@@ -964,6 +964,6 @@ mod tests {
964
964
outpoint : OutPoint { txid : Txid :: from_byte_array ( [ 42 ; 32 ] ) , vout : 0 } ,
965
965
} ,
966
966
pending_htlcs : Vec :: new ( ) ,
967
- } ) ;
967
+ } ) . await ;
968
968
}
969
969
}
0 commit comments