@@ -547,17 +547,22 @@ impl<ChannelSigner: Sign> OnchainTxHandler<ChannelSigner> {
547
547
548
548
/// Upon channelmonitor.block_connected(..) or upon provision of a preimage on the forward link
549
549
/// for this channel, provide new relevant on-chain transactions and/or new claim requests.
550
- /// Formerly this was named `block_connected`, but it is now also used for claiming an HTLC output
551
- /// if we receive a preimage after force-close.
552
- /// `conf_height` represents the height at which the transactions in `txn_matched` were
553
- /// confirmed. This does not need to equal the current blockchain tip height, which should be
554
- /// provided via `cur_height`, however it must never be higher than `cur_height`.
555
- pub ( crate ) fn update_claims_view < B : Deref , F : Deref , L : Deref > ( & mut self , txn_matched : & [ & Transaction ] , requests : Vec < PackageTemplate > , conf_height : u32 , cur_height : u32 , broadcaster : & B , fee_estimator : & LowerBoundedFeeEstimator < F > , logger : & L )
556
- where B :: Target : BroadcasterInterface ,
557
- F :: Target : FeeEstimator ,
558
- L :: Target : Logger ,
550
+ /// Together with `update_claims_view_from_matched_txn` this used to be named
551
+ /// `block_connected`, but it is now also used for claiming an HTLC output if we receive a
552
+ /// preimage after force-close.
553
+ ///
554
+ /// `conf_height` represents the height at which the request was generated. This
555
+ /// does not need to equal the current blockchain tip height, which should be provided via
556
+ /// `cur_height`, however it must never be higher than `cur_height`.
557
+ pub ( crate ) fn update_claims_view_from_requests < B : Deref , F : Deref , L : Deref > (
558
+ & mut self , requests : Vec < PackageTemplate > , conf_height : u32 , cur_height : u32 ,
559
+ broadcaster : & B , fee_estimator : & LowerBoundedFeeEstimator < F > , logger : & L
560
+ ) where
561
+ B :: Target : BroadcasterInterface ,
562
+ F :: Target : FeeEstimator ,
563
+ L :: Target : Logger ,
559
564
{
560
- log_debug ! ( logger, "Updating claims view at height {} with {} matched transactions in block {} and {} claim requests" , cur_height, txn_matched . len ( ) , conf_height , requests. len( ) ) ;
565
+ log_debug ! ( logger, "Updating claims view at height {} with {} claim requests" , cur_height, requests. len( ) ) ;
561
566
let mut preprocessed_requests = Vec :: with_capacity ( requests. len ( ) ) ;
562
567
let mut aggregated_request = None ;
563
568
@@ -637,7 +642,25 @@ impl<ChannelSigner: Sign> OnchainTxHandler<ChannelSigner> {
637
642
self . pending_claim_requests . insert ( txid, req) ;
638
643
}
639
644
}
645
+ }
640
646
647
+ /// Upon channelmonitor.block_connected(..) or upon provision of a preimage on the forward link
648
+ /// for this channel, provide new relevant on-chain transactions and/or new claim requests.
649
+ /// Together with `update_claims_view_from_requests` this used to be named `block_connected`,
650
+ /// but it is now also used for claiming an HTLC output if we receive a preimage after force-close.
651
+ ///
652
+ /// `conf_height` represents the height at which the transactions in `txn_matched` were
653
+ /// confirmed. This does not need to equal the current blockchain tip height, which should be
654
+ /// provided via `cur_height`, however it must never be higher than `cur_height`.
655
+ pub ( crate ) fn update_claims_view_from_matched_txn < B : Deref , F : Deref , L : Deref > (
656
+ & mut self , txn_matched : & [ & Transaction ] , conf_height : u32 , conf_hash : BlockHash ,
657
+ cur_height : u32 , broadcaster : & B , fee_estimator : & LowerBoundedFeeEstimator < F > , logger : & L
658
+ ) where
659
+ B :: Target : BroadcasterInterface ,
660
+ F :: Target : FeeEstimator ,
661
+ L :: Target : Logger ,
662
+ {
663
+ log_debug ! ( logger, "Updating claims view at height {} with {} matched transactions in block {}" , cur_height, txn_matched. len( ) , conf_height) ;
641
664
let mut bump_candidates = HashMap :: new ( ) ;
642
665
for tx in txn_matched {
643
666
// Scan all input to verify is one of the outpoint spent is of interest for us
@@ -665,6 +688,7 @@ impl<ChannelSigner: Sign> OnchainTxHandler<ChannelSigner> {
665
688
let entry = OnchainEventEntry {
666
689
txid: tx. txid( ) ,
667
690
height: conf_height,
691
+ block_hash: Some ( conf_hash) ,
668
692
event: OnchainEvent :: Claim { claim_request: first_claim_txid_height. 0 . clone( ) }
669
693
} ;
670
694
if !self . onchain_events_awaiting_threshold_conf. contains( & entry) {
@@ -705,6 +729,7 @@ impl<ChannelSigner: Sign> OnchainTxHandler<ChannelSigner> {
705
729
let entry = OnchainEventEntry {
706
730
txid : tx. txid ( ) ,
707
731
height : conf_height,
732
+ block_hash : Some ( conf_hash) ,
708
733
event : OnchainEvent :: ContentiousOutpoint { package } ,
709
734
} ;
710
735
if !self . onchain_events_awaiting_threshold_conf . contains ( & entry) {
0 commit comments