- Add pull_request_target trigger for fork secret access
- Use pull_request_target in claude-approve if-condition
- Replace CLAUDE.md references with AGENTS.md
- Replace simple approve/comment prompt with comprehensive
risk-classification prompt (intrinsic PR risk + finding severity)
- Use --request-changes instead of comment when not approving
Inject clock.Clock into swapConfig so that swap initiation times
are deterministic and testable. Update all swap tests to use
TestClock with a fixed time, and assert that InitiationTime
matches the clock value.
Reduce MinConfs from 6 to 3 to allow faster swap attempts while the
server enforces risk-based confirmation requirements. Update
SelectDeposits to prioritize more-confirmed deposits first, increasing
the likelihood of server acceptance. Add client-side logging of
insufficient confirmation details from server error responses.
Add DepositConfirmationStatus and InsufficientConfirmationsDetails
messages to support structured error responses when deposits lack
sufficient confirmations for dynamic risk requirements.
Send the batch confirmation after AssertRegisterConf so the batch
exits cleanly, and use a cancellable context so the batcher stops
before leaktest runs.
The probe monitor goroutine cancelled the probe invoice with the same
monitoring context used by awaitProbe. The caller cancels that context as soon
as swap initiation returns.
If cancellation races with or precedes the invoice-cancel RPC, the cleanup can
be skipped and the probe invoice may remain open longer than intended.
Fix by calling CancelInvoice with context.WithoutCancel(ctx) so cleanup is not
aborted by caller cancellation.
Add a regression test that cancels the parent context between probe success
and invoice cleanup, and verifies CancelInvoice still receives a live context.
`ReleaseRoutingPlugin` called `Done` with the caller context. In the
loop-out payment flow this cleanup is deferred, so the context may already be
canceled by the time teardown runs.
That can prevent mission-control restoration in `Done`, leaving
plugin-induced routing state behind after a swap exits.
Fix this by detaching cancellation in `ReleaseRoutingPlugin` and passing
`context.WithoutCancel(ctx)` to `Done`, so teardown still executes during
caller cancellation.
Also add a regression test that cancels the caller context before release and
asserts the plugin `Done` call still receives a live context.
In manager.go, deferred shim cleanup was calling
FundingStateStep with the original request ctx.
If the user had already canceled that context,
the cleanup RPC would run with a canceled context
and could fail to remove the pending shim. I changed
that cleanup path to use context.WithoutCancel(ctx)
so the cancellation RPC still has a live context.
Remove unused errChan fields from the loopin, openchannel, and withdraw
managers. These channels were declared and initialized but never read
from or written to.
Remove the unused activeLoopIns map from the loopin manager. The map
was only written to but never read, making it dead code.
Remove the stale withdraw.Store interface whose method signatures no
longer match the concrete SqlStore API used by the manager.
Remove unused config fields from openchannel.Config (Server,
AddressManager, ChainNotifier, Signer) and deposit.ManagerConfig
(AddressClient, SwapClient, ChainParams) along with their daemon
wiring. Also remove the now-orphaned openchannel.AddressManager
interface.
Remove the unused GetStaticAddress and Close methods from
address.SqlStore and the GetStaticAddress method from the address.Store
interface, as the codebase only uses GetAllStaticAddresses.
The %w formatting verb is only meaningful for fmt.Errorf where it
enables error wrapping. In log.Errorf it prints as %%!w(error=...),
producing garbled log output. Use %v and add the missing colon
separator.
handleWithdrawal did not check the error returned by
RegisterSpendNtfn before spawning a goroutine to read from the
notification channels. If registration failed, spentChan would be nil
and the goroutine would block forever on a nil channel read.
Add the missing error check so the function returns early on
registration failure.
recoverLoopIns wrote to the activeLoopIns map from inside a goroutine
without any synchronization. The map is shared state accessed from
the manager's main Run loop, creating a data race.
Move the map write before the goroutine spawn so it happens
synchronously during recovery. Also fix the stale log message that
said "OnStart" instead of "OnRecover".
SweepHtlcTimeoutAction used a select with a default case containing a
blocking time.After. When the context was canceled, it logged the error
but continued the retry loop instead of returning. The default case
also meant that ctx.Done was only checked when it was already signaled,
while an hour-long sleep blocked without listening for cancellation.
Replace the default+time.After pattern with a proper select on both
ctx.Done and time.After so the function exits promptly on shutdown.
createHtlcTx always places the HTLC output at index 0 and the change
output (if any) at index 1. Previously, createHtlcSweepTx attempted to
dynamically find the HTLC index but then unconditionally read
TxOut[0].Value, ignoring the computed index.
Replace the dynamic search with a const htlcInputIndex=0 and a fail-fast
check that errors if the layout invariant is ever violated. Add a test
that verifies the sweep value is derived from the HTLC output, not the
change output.