@@ -1276,6 +1276,17 @@ pub enum Event {
1276
1276
/// status of the closing tx.
1277
1277
/// Note that for instances serialized in v0.0.119 or prior this will be missing (None).
1278
1278
channel_funding_txo : Option < transaction:: OutPoint > ,
1279
+ /// An upper bound on the our last local balance in msats before the channel was closed.
1280
+ ///
1281
+ /// Will overstate our balance as it ignores pending outbound HTLCs and transaction fees.
1282
+ ///
1283
+ /// For more accurate balances including fee information see
1284
+ /// [`ChainMonitor::get_claimable_balances`].
1285
+ ///
1286
+ /// This field will be `None` only for objects serialized prior to LDK 0.1.
1287
+ ///
1288
+ /// [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances
1289
+ last_local_balance_msats : Option < u64 > ,
1279
1290
} ,
1280
1291
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
1281
1292
/// inputs for another purpose.
@@ -1555,7 +1566,8 @@ impl Writeable for Event {
1555
1566
} ) ;
1556
1567
} ,
1557
1568
& Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason,
1558
- ref counterparty_node_id, ref channel_capacity_sats, ref channel_funding_txo
1569
+ ref counterparty_node_id, ref channel_capacity_sats, ref channel_funding_txo,
1570
+ ref last_local_balance_msats,
1559
1571
} => {
1560
1572
9u8 . write ( writer) ?;
1561
1573
// `user_channel_id` used to be a single u64 value. In order to remain backwards
@@ -1571,6 +1583,7 @@ impl Writeable for Event {
1571
1583
( 5 , counterparty_node_id, option) ,
1572
1584
( 7 , channel_capacity_sats, option) ,
1573
1585
( 9 , channel_funding_txo, option) ,
1586
+ ( 11 , last_local_balance_msats, option)
1574
1587
} ) ;
1575
1588
} ,
1576
1589
& Event :: DiscardFunding { ref channel_id, ref funding_info } => {
@@ -1939,6 +1952,7 @@ impl MaybeReadable for Event {
1939
1952
let mut counterparty_node_id = None ;
1940
1953
let mut channel_capacity_sats = None ;
1941
1954
let mut channel_funding_txo = None ;
1955
+ let mut last_local_balance_msats = None ;
1942
1956
read_tlv_fields ! ( reader, {
1943
1957
( 0 , channel_id, required) ,
1944
1958
( 1 , user_channel_id_low_opt, option) ,
@@ -1947,6 +1961,7 @@ impl MaybeReadable for Event {
1947
1961
( 5 , counterparty_node_id, option) ,
1948
1962
( 7 , channel_capacity_sats, option) ,
1949
1963
( 9 , channel_funding_txo, option) ,
1964
+ ( 11 , last_local_balance_msats, option)
1950
1965
} ) ;
1951
1966
1952
1967
// `user_channel_id` used to be a single u64 value. In order to remain
@@ -1956,7 +1971,7 @@ impl MaybeReadable for Event {
1956
1971
( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
1957
1972
1958
1973
Ok ( Some ( Event :: ChannelClosed { channel_id, user_channel_id, reason : _init_tlv_based_struct_field ! ( reason, upgradable_required) ,
1959
- counterparty_node_id, channel_capacity_sats, channel_funding_txo } ) )
1974
+ counterparty_node_id, channel_capacity_sats, channel_funding_txo, last_local_balance_msats } ) )
1960
1975
} ;
1961
1976
f ( )
1962
1977
} ,
0 commit comments