@@ -468,6 +468,7 @@ pub(crate) struct ClaimRequest {
468
468
/// TODO: Write docs
469
469
#[ derive( PartialEq ) ]
470
470
struct OnchainEventEntry {
471
+ txid : Txid ,
471
472
height : u32 ,
472
473
event : OnchainEvent ,
473
474
}
@@ -954,6 +955,7 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
954
955
955
956
writer. write_all ( & byte_utils:: be64_to_array ( self . onchain_events_waiting_threshold_conf . len ( ) as u64 ) ) ?;
956
957
for ref entry in self . onchain_events_waiting_threshold_conf . iter ( ) {
958
+ entry. txid . write ( writer) ?;
957
959
writer. write_all ( & byte_utils:: be32_to_array ( entry. height ) ) ?;
958
960
match entry. event {
959
961
OnchainEvent :: HTLCUpdate { ref htlc_update } => {
@@ -1665,6 +1667,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1665
1667
}
1666
1668
} ) ;
1667
1669
let entry = OnchainEventEntry {
1670
+ txid: * $txid,
1668
1671
height,
1669
1672
event: OnchainEvent :: HTLCUpdate {
1670
1673
htlc_update: ( ( * * source) . clone( ) , htlc. payment_hash. clone( ) )
@@ -1730,6 +1733,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1730
1733
}
1731
1734
} ) ;
1732
1735
self . onchain_events_waiting_threshold_conf. push( OnchainEventEntry {
1736
+ txid: * $txid,
1733
1737
height,
1734
1738
event: OnchainEvent :: HTLCUpdate {
1735
1739
htlc_update: ( ( * * source) . clone( ) , htlc. payment_hash. clone( ) )
@@ -1885,6 +1889,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
1885
1889
}
1886
1890
} ) ;
1887
1891
let entry = OnchainEventEntry {
1892
+ txid: commitment_txid,
1888
1893
height,
1889
1894
event: OnchainEvent :: HTLCUpdate { htlc_update: ( $source, $payment_hash) } ,
1890
1895
} ;
@@ -2368,6 +2373,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2368
2373
}
2369
2374
} ) ;
2370
2375
let entry = OnchainEventEntry {
2376
+ txid : tx. txid ( ) ,
2371
2377
height,
2372
2378
event : OnchainEvent :: HTLCUpdate { htlc_update : ( source, payment_hash) } ,
2373
2379
} ;
@@ -2432,6 +2438,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2432
2438
}
2433
2439
if let Some ( spendable_output) = spendable_output {
2434
2440
let entry = OnchainEventEntry {
2441
+ txid : tx. txid ( ) ,
2435
2442
height : height,
2436
2443
event : OnchainEvent :: MaturingOutput { descriptor : spendable_output. clone ( ) } ,
2437
2444
} ;
@@ -2704,6 +2711,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2704
2711
let waiting_threshold_conf_len: u64 = Readable :: read ( reader) ?;
2705
2712
let mut onchain_events_waiting_threshold_conf = Vec :: with_capacity ( cmp:: min ( waiting_threshold_conf_len as usize , MAX_ALLOC_SIZE / 128 ) ) ;
2706
2713
for _ in 0 ..waiting_threshold_conf_len {
2714
+ let txid = Readable :: read ( reader) ?;
2707
2715
let height = Readable :: read ( reader) ?;
2708
2716
let event = match <u8 as Readable >:: read ( reader) ? {
2709
2717
0 => {
@@ -2721,7 +2729,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
2721
2729
} ,
2722
2730
_ => return Err ( DecodeError :: InvalidValue ) ,
2723
2731
} ;
2724
- onchain_events_waiting_threshold_conf. push ( OnchainEventEntry { height, event } ) ;
2732
+ onchain_events_waiting_threshold_conf. push ( OnchainEventEntry { txid , height, event } ) ;
2725
2733
}
2726
2734
2727
2735
let outputs_to_watch_len: u64 = Readable :: read ( reader) ?;
0 commit comments