@@ -39,7 +39,6 @@ use util::errors::APIError;
39
39
use util:: config:: { UserConfig , ChannelConfig } ;
40
40
41
41
use std;
42
- use std:: default:: Default ;
43
42
use std:: { cmp, mem, fmt} ;
44
43
use std:: ops:: Deref ;
45
44
#[ cfg( any( test, feature = "fuzztarget" ) ) ]
@@ -368,8 +367,6 @@ pub(super) struct Channel<Signer: Sign> {
368
367
/// could miss the funding_tx_confirmed_in block as well, but it serves as a useful fallback.
369
368
funding_tx_confirmed_in : Option < BlockHash > ,
370
369
short_channel_id : Option < u64 > ,
371
- /// Used to verify consistency during ChannelManager deserialization (hence pub(super)).
372
- pub ( super ) last_block_connected : BlockHash ,
373
370
funding_tx_confirmations : u64 ,
374
371
375
372
counterparty_dust_limit_satoshis : u64 ,
@@ -568,7 +565,6 @@ impl<Signer: Sign> Channel<Signer> {
568
565
569
566
funding_tx_confirmed_in : None ,
570
567
short_channel_id : None ,
571
- last_block_connected : Default :: default ( ) ,
572
568
funding_tx_confirmations : 0 ,
573
569
574
570
feerate_per_kw : feerate,
@@ -804,7 +800,6 @@ impl<Signer: Sign> Channel<Signer> {
804
800
805
801
funding_tx_confirmed_in : None ,
806
802
short_channel_id : None ,
807
- last_block_connected : Default :: default ( ) ,
808
803
funding_tx_confirmations : 0 ,
809
804
810
805
feerate_per_kw : msg. feerate_per_kw ,
@@ -3568,7 +3563,6 @@ impl<Signer: Sign> Channel<Signer> {
3568
3563
}
3569
3564
}
3570
3565
3571
- self . last_block_connected = header. block_hash ( ) ;
3572
3566
self . update_time_counter = cmp:: max ( self . update_time_counter , header. time ) ;
3573
3567
if self . funding_tx_confirmations > 0 {
3574
3568
if self . funding_tx_confirmations == self . minimum_depth as u64 {
@@ -3590,7 +3584,7 @@ impl<Signer: Sign> Channel<Signer> {
3590
3584
// funding_tx_confirmed_in and return.
3591
3585
false
3592
3586
} ;
3593
- self . funding_tx_confirmed_in = Some ( self . last_block_connected ) ;
3587
+ self . funding_tx_confirmed_in = Some ( header . block_hash ( ) ) ;
3594
3588
3595
3589
//TODO: Note that this must be a duplicate of the previous commitment point they sent us,
3596
3590
//as otherwise we will have a commitment transaction that they can't revoke (well, kinda,
@@ -3623,8 +3617,7 @@ impl<Signer: Sign> Channel<Signer> {
3623
3617
return true ;
3624
3618
}
3625
3619
}
3626
- self . last_block_connected = header. block_hash ( ) ;
3627
- if Some ( self . last_block_connected ) == self . funding_tx_confirmed_in {
3620
+ if Some ( header. block_hash ( ) ) == self . funding_tx_confirmed_in {
3628
3621
self . funding_tx_confirmations = self . minimum_depth as u64 - 1 ;
3629
3622
}
3630
3623
false
@@ -4433,8 +4426,6 @@ impl<Signer: Sign> Writeable for Channel<Signer> {
4433
4426
4434
4427
self . funding_tx_confirmed_in . write ( writer) ?;
4435
4428
self . short_channel_id . write ( writer) ?;
4436
-
4437
- self . last_block_connected . write ( writer) ?;
4438
4429
self . funding_tx_confirmations . write ( writer) ?;
4439
4430
4440
4431
self . counterparty_dust_limit_satoshis . write ( writer) ?;
@@ -4595,8 +4586,6 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<&'a K> for Channel<Signer>
4595
4586
4596
4587
let funding_tx_confirmed_in = Readable :: read ( reader) ?;
4597
4588
let short_channel_id = Readable :: read ( reader) ?;
4598
-
4599
- let last_block_connected = Readable :: read ( reader) ?;
4600
4589
let funding_tx_confirmations = Readable :: read ( reader) ?;
4601
4590
4602
4591
let counterparty_dust_limit_satoshis = Readable :: read ( reader) ?;
@@ -4667,7 +4656,6 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<&'a K> for Channel<Signer>
4667
4656
4668
4657
funding_tx_confirmed_in,
4669
4658
short_channel_id,
4670
- last_block_connected,
4671
4659
funding_tx_confirmations,
4672
4660
4673
4661
counterparty_dust_limit_satoshis,
0 commit comments