Skip to content

Fix private-channel swap routing#124

Merged
zoedberg merged 2 commits intoRGB-Tools:masterfrom
bitwalt:private-channel-swap-routing
Apr 30, 2026
Merged

Fix private-channel swap routing#124
zoedberg merged 2 commits intoRGB-Tools:masterfrom
bitwalt:private-channel-swap-routing

Conversation

@bitwalt
Copy link
Copy Markdown
Contributor

@bitwalt bitwalt commented Apr 29, 2026

Summary

  • update the existing same-channel swap test to cover private-channel routing
  • pass local usable channels as first_hops when route finding starts from our own node

Root Cause

The swap route lookup did not provide LDK with local first-hop channels. That works for public channels discoverable from graph data, but private channels are not in the public graph, so route finding could fail with No route found even when a usable local private channel exists.

Validation

  • cargo fmt --check
  • cargo check
  • cargo test test::swap_reverse_same_channel::swap_reverse_private_same_channel -- --exact --test-threads=1 --nocapture

Fixes #123

@bitwalt bitwalt marked this pull request as ready for review April 29, 2026 16:02
Copy link
Copy Markdown
Member

@zoedberg zoedberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Please address the requested changes and check the swap_assets_liquidity_both_ways test which seems to fail both on the CI and locally

Comment thread src/utils.rs Outdated
Comment thread src/utils.rs Outdated
Comment thread src/test/mod.rs Outdated
Comment thread src/test/swap_reverse_same_channel.rs Outdated
@bitwalt bitwalt force-pushed the private-channel-swap-routing branch from 1ec01bd to 720795f Compare April 29, 2026 20:09
@bitwalt bitwalt force-pushed the private-channel-swap-routing branch from 720795f to 21cc5cf Compare April 29, 2026 20:13
@bitwalt
Copy link
Copy Markdown
Contributor Author

bitwalt commented Apr 30, 2026

Changes should have been addressed

Copy link
Copy Markdown
Member

@zoedberg zoedberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zoedberg zoedberg merged commit 02fbddd into RGB-Tools:master Apr 30, 2026
12 checks passed
@bitwalt bitwalt deleted the private-channel-swap-routing branch April 30, 2026 08:41
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.

Private same-channel swaps fail with No route found

2 participants