Skip to content

Commit eb83234

Browse files
committed
Fix backwards compatibility of NodeMetrics reads
In commit dd55d47 we started ignoring the legacy `latest_channel_monitor_archival_height` field of `NodeMetrics`. However, we erroneously started reading it as `Option<u32>`, though, given it's an optional field, it should have been read as a plain `u32` that might or might not be present. Here we fix this error.
1 parent 80a1745 commit eb83234

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ impl_writeable_tlv_based!(NodeMetrics, {
18371837
(6, latest_rgs_snapshot_timestamp, option),
18381838
(8, latest_node_announcement_broadcast_timestamp, option),
18391839
// 10 used to be latest_channel_monitor_archival_height
1840-
(10, _legacy_latest_channel_monitor_archival_height, (legacy, Option<u32>, |_: &NodeMetrics| None::<Option<u32>> )),
1840+
(10, _legacy_latest_channel_monitor_archival_height, (legacy, u32, |_: &NodeMetrics| None::<Option<u32>> )),
18411841
});
18421842

18431843
pub(crate) fn total_anchor_channels_reserve_sats(

0 commit comments

Comments
 (0)