Set dont_forward on private channel updates and add tests #4340
+134
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1672.
Summary
dont_forwardbit (message_flags bit 1) onchannel_updatemessages for private channels.channel_updatewithdont_forwardset for an unknown channel.Details
ChannelManager::get_channel_update_for_unicast, we now compute:message_flags = 1 | (1 << 1)for private channels (must_be_one + dont_forward).message_flags = 1for public channels (must_be_one only).internal_channel_update, if we receive achannel_updatefor an unknownshort_channel_idand thedont_forwardbit is set, we log a warning suggesting the user check thetx_indexpassed tochain::Confirm::transactions_confirmed.Tests
test_channel_update_dont_forward_flagtest_unknown_channel_update_with_dont_forward_logs_warningBased on lightning/bolts#999: BOLT 7
dont_forwardflag for SCID aliases.