Skip to content

Commit 2e71bf1

Browse files
Implement serialization for ChannelDetails
Will be used in upcoming commit(s) where it may be desirable to cache ChannelDetails routehints
1 parent c49bc98 commit 2e71bf1

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5755,6 +5755,38 @@ impl PersistenceNotifier {
57555755
const SERIALIZATION_VERSION: u8 = 1;
57565756
const MIN_SERIALIZATION_VERSION: u8 = 1;
57575757

5758+
impl_writeable_tlv_based!(CounterpartyForwardingInfo, {
5759+
(2, fee_base_msat, required),
5760+
(4, fee_proportional_millionths, required),
5761+
(6, cltv_expiry_delta, required),
5762+
});
5763+
5764+
impl_writeable_tlv_based!(ChannelCounterparty, {
5765+
(2, node_id, required),
5766+
(4, features, required),
5767+
(6, unspendable_punishment_reserve, required),
5768+
(8, forwarding_info, option),
5769+
});
5770+
5771+
impl_writeable_tlv_based!(ChannelDetails, {
5772+
(2, channel_id, required),
5773+
(4, counterparty, required),
5774+
(6, funding_txo, option),
5775+
(8, short_channel_id, option),
5776+
(10, channel_value_satoshis, required),
5777+
(12, unspendable_punishment_reserve, option),
5778+
(14, user_channel_id, required),
5779+
(16, balance_msat, required),
5780+
(18, outbound_capacity_msat, required),
5781+
(20, inbound_capacity_msat, required),
5782+
(22, confirmations_required, option),
5783+
(24, force_close_spend_delay, option),
5784+
(26, is_outbound, required),
5785+
(28, is_funding_locked, required),
5786+
(30, is_usable, required),
5787+
(32, is_public, required),
5788+
});
5789+
57585790
impl_writeable_tlv_based_enum!(PendingHTLCRouting,
57595791
(0, Forward) => {
57605792
(0, onion_packet, required),

0 commit comments

Comments
 (0)