@@ -387,7 +387,7 @@ impl OnchainEventEntry {
387
387
}
388
388
389
389
fn has_reached_confirmation_threshold ( & self , best_block : & BestBlock ) -> bool {
390
- best_block. height ( ) >= self . confirmation_threshold ( )
390
+ best_block. height >= self . confirmation_threshold ( )
391
391
}
392
392
}
393
393
@@ -1077,8 +1077,8 @@ impl<Signer: WriteableEcdsaChannelSigner> Writeable for ChannelMonitorImpl<Signe
1077
1077
event. write ( writer) ?;
1078
1078
}
1079
1079
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 ( ) ) ?;
1082
1082
1083
1083
writer. write_all ( & ( self . onchain_events_awaiting_threshold_conf . len ( ) as u64 ) . to_be_bytes ( ) ) ?;
1084
1084
for ref entry in self . onchain_events_awaiting_threshold_conf . iter ( ) {
@@ -2273,7 +2273,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitor<Signer> {
2273
2273
// before considering it "no longer pending" - this matches when we
2274
2274
// provide the ChannelManager an HTLC failure event.
2275
2275
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
2277
2277
} else if let OnchainEvent :: HTLCSpendConfirmation { commitment_tx_output_idx, .. } = event. event {
2278
2278
// If the HTLC was fulfilled with a preimage, we consider the HTLC
2279
2279
// immediately non-pending, matching when we provide ChannelManager
@@ -2674,7 +2674,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2674
2674
macro_rules! claim_htlcs {
2675
2675
( $commitment_number: expr, $txid: expr) => {
2676
2676
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) ;
2678
2678
}
2679
2679
}
2680
2680
if let Some ( txid) = self . current_counterparty_commitment_txid {
@@ -2721,8 +2721,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2721
2721
// Assume that the broadcasted commitment transaction confirmed in the current best
2722
2722
// block. Even if not, its a reasonable metric for the bump criteria on the HTLC
2723
2723
// 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) ;
2726
2726
}
2727
2727
}
2728
2728
}
@@ -2736,7 +2736,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2736
2736
let commitment_package = PackageTemplate :: build_package (
2737
2737
self . funding_info . 0 . txid . clone ( ) , self . funding_info . 0 . index as u32 ,
2738
2738
PackageSolvingData :: HolderFundingOutput ( funding_outp) ,
2739
- self . best_block . height ( ) , self . best_block . height ( )
2739
+ self . best_block . height , self . best_block . height
2740
2740
) ;
2741
2741
let mut claimable_outpoints = vec ! [ commitment_package] ;
2742
2742
self . pending_monitor_events . push ( MonitorEvent :: HolderForceClosed ( self . funding_info . 0 ) ) ;
@@ -2753,7 +2753,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2753
2753
// assuming it gets confirmed in the next block. Sadly, we have code which considers
2754
2754
// "not yet confirmed" things as discardable, so we cannot do that here.
2755
2755
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
2757
2757
) ;
2758
2758
let unsigned_commitment_tx = self . onchain_tx_handler . get_unsigned_holder_commitment_tx ( ) ;
2759
2759
let new_outputs = self . get_broadcasted_holder_watch_outputs (
@@ -2777,7 +2777,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
2777
2777
{
2778
2778
let ( claimable_outpoints, _) = self . generate_claimable_outpoints_and_watch_outputs ( ) ;
2779
2779
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,
2781
2781
fee_estimator, logger
2782
2782
) ;
2783
2783
}
@@ -3593,11 +3593,11 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
3593
3593
{
3594
3594
let block_hash = header. block_hash ( ) ;
3595
3595
3596
- if height > self . best_block . height ( ) {
3596
+ if height > self . best_block . height {
3597
3597
self . best_block = BestBlock :: new ( block_hash, height) ;
3598
3598
log_trace ! ( logger, "Connecting new block {} at height {}" , block_hash, height) ;
3599
3599
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 {
3601
3601
self . best_block = BestBlock :: new ( block_hash, height) ;
3602
3602
log_trace ! ( logger, "Best block re-orged, replaced with new block {} at height {}" , block_hash, height) ;
3603
3603
self . onchain_events_awaiting_threshold_conf . retain ( |ref entry| entry. height <= height) ;
@@ -3742,7 +3742,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
3742
3742
}
3743
3743
}
3744
3744
3745
- if height > self . best_block . height ( ) {
3745
+ if height > self . best_block . height {
3746
3746
self . best_block = BestBlock :: new ( block_hash, height) ;
3747
3747
}
3748
3748
@@ -3774,7 +3774,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
3774
3774
L :: Target : Logger ,
3775
3775
{
3776
3776
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) ;
3778
3778
3779
3779
let should_broadcast = self . should_broadcast_holder_commitment_txn ( logger) ;
3780
3780
if should_broadcast {
@@ -3865,8 +3865,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
3865
3865
}
3866
3866
}
3867
3867
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) ;
3870
3870
3871
3871
// Determine new outputs to watch by comparing against previously known outputs to watch,
3872
3872
// updating the latter in the process.
@@ -4017,7 +4017,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
4017
4017
// to the source, and if we don't fail the channel we will have to ensure that the next
4018
4018
// updates that peer sends us are update_fails, failing the channel if not. It's probably
4019
4019
// 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 ;
4021
4021
macro_rules! scan_commitment {
4022
4022
( $htlcs: expr, $holder_tx: expr) => {
4023
4023
for ref htlc in $htlcs {
@@ -4616,7 +4616,7 @@ impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP
4616
4616
chan_utils:: get_to_countersignatory_with_anchors_redeemscript ( & payment_point) . to_v0_p2wsh ( ) ;
4617
4617
}
4618
4618
4619
- Ok ( ( best_block. block_hash ( ) , ChannelMonitor :: from_impl ( ChannelMonitorImpl {
4619
+ Ok ( ( best_block. block_hash , ChannelMonitor :: from_impl ( ChannelMonitorImpl {
4620
4620
latest_update_id,
4621
4621
commitment_transaction_number_obscure_factor,
4622
4622
0 commit comments