Skip to content

Commit 9529650

Browse files
committed
fixup! Add ReserveType to ChannelDetails
document the selection of adaptive reserve type in the event a user sets and then unsets the anchor channels config
1 parent 83d8c1c commit 9529650

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/types.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,13 @@ impl ChannelDetails {
637637
ReserveType::Adaptive
638638
}
639639
} else {
640+
// Edge case: if `AnchorChannelsConfig` was previously set and later
641+
// removed, we can no longer distinguish whether this anchor channel's
642+
// reserve was `Adaptive` or `TrustedPeersNoReserve`. We default to
643+
// `Adaptive` here, which may incorrectly override a prior
644+
// `TrustedPeersNoReserve` designation. This is acceptable since
645+
// unsetting `AnchorChannelsConfig` on a node with existing anchor
646+
// channels is not an expected operation.
640647
ReserveType::Adaptive
641648
}
642649
} else {

0 commit comments

Comments
 (0)