9 Commits
Author SHA1 Message Date
Gijs van Dam 09379d0381 wtclient: fix race conditions locking tests
This commit fixes two flaky test scenarios:

1. testRemoveLockedAddr: Add synchronization to wait for the dial to
   start before asserting that the address is locked. Previously, the
   test could race and check the lock state before session negotiation
   began.

2. testTowerSwitch: Use wait.Predicate for RemoveTower since the
   address may still be locked by an active session, causing
   intermittent failures.
2026-02-12 13:02:02 +01:00
Gijs van Dam 6ea99cde42 invoices: increase timeout parallel Postgres tests
Increase the test timeout from 10s to 60s to accommodate slow
Postgres database setup and migrations when running tests in
parallel. This prevents false-positive test failures on slower
CI runners.
2026-02-12 13:01:50 +01:00
Gijs van Dam 2643988524 make: fix linter in git worktrees
When running `make lint` in a git worktree, the diff processor fails
with "no version control repository found" because the Docker container
only mounts the worktree directory, not the main git directory that the
worktree's .git file references.

This causes golangci-lint's `new-from-rev` filter to not work, resulting
in all ~32k existing lint issues being reported instead of only newly
introduced ones.

Fix by detecting when we're in a worktree (.git is a file, not a
directory) and mounting the main .git directory into the container so
revgrep can access the git history.
2026-02-03 19:45:56 +01:00
Gijs van Dam e7b9515edd fn: fix Result[T].FlatMap
For a Result[T], FlatMap should apply f when the result is Ok, and
propagate the error unchanged when it's Err. The original code returns r
on Ok and tries to use r.left when Err, which is wrong. This commit
fixes that.

Secondly, the group of FlatMap/AndThen and OrElse functions and methods
are now properly tested with new unit tests.

fixes #10401
2026-01-06 10:51:49 +01:00
Gijs van Dam 93c50bc69a docs: update release notes for 0.21.0 2025-11-12 22:54:04 +08:00
Gijs van Dam c37b18cf82 chore: thread context through to SendCustomMessage
The only way to unblock SendCustomMessage is if the peer activates,
disconnects or the server shuts down. This means that if the context is
cancelled, we will still wait until one of those other events happen.

With this commit we thread the context through to SendCustomMessage, so
that if the context is cancelled, we can return early. This improves the
cancellation semantics.
2025-11-12 22:54:04 +08:00
Gijs van Dam 07dc74e198 multi: endpoints for onion messages
This commit creates the necessary endpoints for onion messages.
Specifically, it adds the following:

- `SendOnionMessage` endpoint to send onion messages.
- `SubscribeOnionMessages` endpoint to subscribe to incoming onion
  messages.

It uses the `msgmux` package to handle the onion messages.
2025-11-12 22:54:04 +08:00
Gijs van Dam 2ee0702942 lnrpc: SendOnionMessage rpc endpoint 2025-11-12 22:54:04 +08:00
Gijs van Dam cb2d8abe40 lnwire: add onion message type
This message type is a message that carries an onion-encrypted payload
used for BOLT12 messages.
2025-11-12 22:54:03 +08:00