@@ -387,7 +387,7 @@ impl OnchainEventEntry {
387387 }
388388
389389 fn has_reached_confirmation_threshold ( & self , best_block : & BestBlock ) -> bool {
390- best_block. height ( ) >= self . confirmation_threshold ( )
390+ best_block. height >= self . confirmation_threshold ( )
391391 }
392392}
393393
@@ -1077,8 +1077,8 @@ impl<Signer: WriteableEcdsaChannelSigner> Writeable for ChannelMonitorImpl<Signe
10771077 event. write ( writer) ?;
10781078 }
10791079
1080- self . best_block . block_hash ( ) . write ( writer) ?;
1081- writer. write_all ( & self . best_block . height ( ) . to_be_bytes ( ) ) ?;
1080+ self . best_block . block_hash . write ( writer) ?;
1081+ writer. write_all ( & self . best_block . height . to_be_bytes ( ) ) ?;
10821082
10831083 writer. write_all ( & ( self . onchain_events_awaiting_threshold_conf . len ( ) as u64 ) . to_be_bytes ( ) ) ?;
10841084 for ref entry in self . onchain_events_awaiting_threshold_conf . iter ( ) {
@@ -2273,7 +2273,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
22732273 // before considering it "no longer pending" - this matches when we
22742274 // provide the ChannelManager an HTLC failure event.
22752275 Some ( commitment_tx_output_idx) == htlc. transaction_output_index &&
2276- us. best_block. height( ) >= event. height + ANTI_REORG_DELAY - 1
2276+ us. best_block. height >= event. height + ANTI_REORG_DELAY - 1
22772277 } else if let OnchainEvent :: HTLCSpendConfirmation { commitment_tx_output_idx, .. } = event. event {
22782278 // If the HTLC was fulfilled with a preimage, we consider the HTLC
22792279 // immediately non-pending, matching when we provide ChannelManager
@@ -2674,7 +2674,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
26742674 macro_rules! claim_htlcs {
26752675 ( $commitment_number: expr, $txid: expr) => {
26762676 let ( htlc_claim_reqs, _) = self . get_counterparty_output_claim_info( $commitment_number, $txid, None ) ;
2677- self . onchain_tx_handler. update_claims_view_from_requests( htlc_claim_reqs, self . best_block. height( ) , self . best_block. height( ) , broadcaster, fee_estimator, logger) ;
2677+ self . onchain_tx_handler. update_claims_view_from_requests( htlc_claim_reqs, self . best_block. height, self . best_block. height, broadcaster, fee_estimator, logger) ;
26782678 }
26792679 }
26802680 if let Some ( txid) = self . current_counterparty_commitment_txid {
@@ -2721,8 +2721,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
27212721 // Assume that the broadcasted commitment transaction confirmed in the current best
27222722 // block. Even if not, its a reasonable metric for the bump criteria on the HTLC
27232723 // transactions.
2724- let ( claim_reqs, _) = self . get_broadcasted_holder_claims ( & holder_commitment_tx, self . best_block . height ( ) ) ;
2725- self . onchain_tx_handler . update_claims_view_from_requests ( claim_reqs, self . best_block . height ( ) , self . best_block . height ( ) , broadcaster, fee_estimator, logger) ;
2724+ let ( claim_reqs, _) = self . get_broadcasted_holder_claims ( & holder_commitment_tx, self . best_block . height ) ;
2725+ self . onchain_tx_handler . update_claims_view_from_requests ( claim_reqs, self . best_block . height , self . best_block . height , broadcaster, fee_estimator, logger) ;
27262726 }
27272727 }
27282728 }
@@ -2736,7 +2736,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
27362736 let commitment_package = PackageTemplate :: build_package (
27372737 self . funding_info . 0 . txid . clone ( ) , self . funding_info . 0 . index as u32 ,
27382738 PackageSolvingData :: HolderFundingOutput ( funding_outp) ,
2739- self . best_block . height ( ) , self . best_block . height ( )
2739+ self . best_block . height , self . best_block . height
27402740 ) ;
27412741 let mut claimable_outpoints = vec ! [ commitment_package] ;
27422742 self . pending_monitor_events . push ( MonitorEvent :: HolderForceClosed ( self . funding_info . 0 ) ) ;
@@ -2753,7 +2753,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
27532753 // assuming it gets confirmed in the next block. Sadly, we have code which considers
27542754 // "not yet confirmed" things as discardable, so we cannot do that here.
27552755 let ( mut new_outpoints, _) = self . get_broadcasted_holder_claims (
2756- & self . current_holder_commitment_tx , self . best_block . height ( )
2756+ & self . current_holder_commitment_tx , self . best_block . height
27572757 ) ;
27582758 let unsigned_commitment_tx = self . onchain_tx_handler . get_unsigned_holder_commitment_tx ( ) ;
27592759 let new_outputs = self . get_broadcasted_holder_watch_outputs (
@@ -2777,7 +2777,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
27772777 {
27782778 let ( claimable_outpoints, _) = self . generate_claimable_outpoints_and_watch_outputs ( ) ;
27792779 self . onchain_tx_handler . update_claims_view_from_requests (
2780- claimable_outpoints, self . best_block . height ( ) , self . best_block . height ( ) , broadcaster,
2780+ claimable_outpoints, self . best_block . height , self . best_block . height , broadcaster,
27812781 fee_estimator, logger
27822782 ) ;
27832783 }
@@ -3593,11 +3593,11 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
35933593 {
35943594 let block_hash = header. block_hash ( ) ;
35953595
3596- if height > self . best_block . height ( ) {
3596+ if height > self . best_block . height {
35973597 self . best_block = BestBlock :: new ( block_hash, height) ;
35983598 log_trace ! ( logger, "Connecting new block {} at height {}" , block_hash, height) ;
35993599 self . block_confirmed ( height, block_hash, vec ! [ ] , vec ! [ ] , vec ! [ ] , & broadcaster, & fee_estimator, logger)
3600- } else if block_hash != self . best_block . block_hash ( ) {
3600+ } else if block_hash != self . best_block . block_hash {
36013601 self . best_block = BestBlock :: new ( block_hash, height) ;
36023602 log_trace ! ( logger, "Best block re-orged, replaced with new block {} at height {}" , block_hash, height) ;
36033603 self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
@@ -3742,7 +3742,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
37423742 }
37433743 }
37443744
3745- if height > self . best_block . height ( ) {
3745+ if height > self . best_block . height {
37463746 self . best_block = BestBlock :: new ( block_hash, height) ;
37473747 }
37483748
@@ -3774,7 +3774,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
37743774 L :: Target : Logger ,
37753775 {
37763776 log_trace ! ( logger, "Processing {} matched transactions for block at height {}." , txn_matched. len( ) , conf_height) ;
3777- debug_assert ! ( self . best_block. height( ) >= conf_height) ;
3777+ debug_assert ! ( self . best_block. height >= conf_height) ;
37783778
37793779 let should_broadcast = self . should_broadcast_holder_commitment_txn ( logger) ;
37803780 if should_broadcast {
@@ -3865,8 +3865,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
38653865 }
38663866 }
38673867
3868- self . onchain_tx_handler . update_claims_view_from_requests ( claimable_outpoints, conf_height, self . best_block . height ( ) , broadcaster, fee_estimator, logger) ;
3869- self . onchain_tx_handler . update_claims_view_from_matched_txn ( & txn_matched, conf_height, conf_hash, self . best_block . height ( ) , broadcaster, fee_estimator, logger) ;
3868+ self . onchain_tx_handler . update_claims_view_from_requests ( claimable_outpoints, conf_height, self . best_block . height , broadcaster, fee_estimator, logger) ;
3869+ self . onchain_tx_handler . update_claims_view_from_matched_txn ( & txn_matched, conf_height, conf_hash, self . best_block . height , broadcaster, fee_estimator, logger) ;
38703870
38713871 // Determine new outputs to watch by comparing against previously known outputs to watch,
38723872 // updating the latter in the process.
@@ -4017,7 +4017,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
40174017 // to the source, and if we don't fail the channel we will have to ensure that the next
40184018 // updates that peer sends us are update_fails, failing the channel if not. It's probably
40194019 // easier to just fail the channel as this case should be rare enough anyway.
4020- let height = self . best_block . height ( ) ;
4020+ let height = self . best_block . height ;
40214021 macro_rules! scan_commitment {
40224022 ( $htlcs: expr, $holder_tx: expr) => {
40234023 for ref htlc in $htlcs {
@@ -4616,7 +4616,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
46164616 chan_utils:: get_to_countersignatory_with_anchors_redeemscript ( & payment_point) . to_v0_p2wsh ( ) ;
46174617 }
46184618
4619- Ok ( ( best_block. block_hash ( ) , ChannelMonitor :: from_impl ( ChannelMonitorImpl {
4619+ Ok ( ( best_block. block_hash , ChannelMonitor :: from_impl ( ChannelMonitorImpl {
46204620 latest_update_id,
46214621 commitment_transaction_number_obscure_factor,
46224622
0 commit comments