@@ -1276,6 +1276,15 @@ 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
+ last_local_balance_msats : Option < u64 > ,
1279
1288
} ,
1280
1289
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
1281
1290
/// inputs for another purpose.
@@ -1555,7 +1564,8 @@ impl Writeable for Event {
1555
1564
} ) ;
1556
1565
} ,
1557
1566
& Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason,
1558
- ref counterparty_node_id, ref channel_capacity_sats, ref channel_funding_txo
1567
+ ref counterparty_node_id, ref channel_capacity_sats, ref channel_funding_txo,
1568
+ ref last_local_balance_msats,
1559
1569
} => {
1560
1570
9u8 . write ( writer) ?;
1561
1571
// `user_channel_id` used to be a single u64 value. In order to remain backwards
@@ -1571,6 +1581,7 @@ impl Writeable for Event {
1571
1581
( 5 , counterparty_node_id, option) ,
1572
1582
( 7 , channel_capacity_sats, option) ,
1573
1583
( 9 , channel_funding_txo, option) ,
1584
+ ( 11 , last_local_balance_msats, option)
1574
1585
} ) ;
1575
1586
} ,
1576
1587
& Event :: DiscardFunding { ref channel_id, ref funding_info } => {
@@ -1939,6 +1950,7 @@ impl MaybeReadable for Event {
1939
1950
let mut counterparty_node_id = None ;
1940
1951
let mut channel_capacity_sats = None ;
1941
1952
let mut channel_funding_txo = None ;
1953
+ let mut last_local_balance_msats = None ;
1942
1954
read_tlv_fields ! ( reader, {
1943
1955
( 0 , channel_id, required) ,
1944
1956
( 1 , user_channel_id_low_opt, option) ,
@@ -1947,6 +1959,7 @@ impl MaybeReadable for Event {
1947
1959
( 5 , counterparty_node_id, option) ,
1948
1960
( 7 , channel_capacity_sats, option) ,
1949
1961
( 9 , channel_funding_txo, option) ,
1962
+ ( 11 , last_local_balance_msats, option)
1950
1963
} ) ;
1951
1964
1952
1965
// `user_channel_id` used to be a single u64 value. In order to remain
@@ -1956,7 +1969,7 @@ impl MaybeReadable for Event {
1956
1969
( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
1957
1970
1958
1971
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 } ) )
1972
+ counterparty_node_id, channel_capacity_sats, channel_funding_txo, last_local_balance_msats } ) )
1960
1973
} ;
1961
1974
f ( )
1962
1975
} ,
0 commit comments