Skip to content

Conversation

@Thrishalmadasu
Copy link

@Thrishalmadasu Thrishalmadasu commented Jan 23, 2026

Fixes #1672.

Summary

  • Set the dont_forward bit (message_flags bit 1) on channel_update messages for private channels.
  • Log a warning when we receive a channel_update with dont_forward set for an unknown channel.
  • Add tests to cover both outbound flag setting and inbound warning logging.

Details

  • In ChannelManager::get_channel_update_for_unicast, we now compute:
    • message_flags = 1 | (1 << 1) for private channels (must_be_one + dont_forward).
    • message_flags = 1 for public channels (must_be_one only).
  • In internal_channel_update, if we receive a channel_update for an unknown short_channel_id and the dont_forward bit is set, we log a warning suggesting the user check the tx_index passed to chain::Confirm::transactions_confirmed.

Tests

  • New tests:
    • test_channel_update_dont_forward_flag
    • test_unknown_channel_update_with_dont_forward_logs_warning

Based on lightning/bolts#999: BOLT 7 dont_forward flag for SCID aliases.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 23, 2026

I've assigned @wpaulino as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (8cdc86a) to head (b0883ba).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4340      +/-   ##
==========================================
+ Coverage   86.53%   86.80%   +0.26%     
==========================================
  Files         158      158              
  Lines      103190   102790     -400     
  Branches   103190   102790     -400     
==========================================
- Hits        89300    89223      -77     
+ Misses      11469    11222     -247     
+ Partials     2421     2345      -76     
Flag Coverage Δ
fuzzing 36.20% <25.00%> (-0.87%) ⬇️
tests 86.09% <100.00%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Thrishalmadasu Thrishalmadasu marked this pull request as ready for review January 23, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set the new dont_forward bit in channel_update messages

2 participants