From f4f0f061791e3eacd3c789748d44eb0c22940ed9 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 10 Nov 2025 17:46:39 -0300 Subject: [PATCH 1/2] go.mod: update lndclient Include https://github.com/lightninglabs/lndclient/pull/255 TODO: remove replace --- go.mod | 2 ++ go.sum | 4 ++-- loopin_testcontext_test.go | 4 +++- server_mock_test.go | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 63b57f0ce..a056c5980 100644 --- a/go.mod +++ b/go.mod @@ -225,4 +225,6 @@ replace gonum.org/v1/gonum => github.com/gonum/gonum v0.11.0 replace gonum.org/v1/plot => github.com/gonum/plot v0.10.1 +replace github.com/lightninglabs/lndclient => github.com/starius/lndclient v0.20.0-1-ports.0.20251110204322-be4fd2c52ae3 + go 1.24.6 diff --git a/go.sum b/go.sum index ad8ea4e0e..c631c41f2 100644 --- a/go.sum +++ b/go.sum @@ -1107,8 +1107,6 @@ github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk= github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.3 h1:NuDp6Z+QNMSzZ/+RzWsjgAgQSr/REDxTiHmTczZxlXA= github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.3/go.mod h1:bDnEKRN1u13NFBuy/C+bFLhxA5bfd3clT25y76QY0AM= -github.com/lightninglabs/lndclient v0.20.0-1 h1:xwDoh7z3bszXc4mkMO6ksEcXhkQw9v0XHJ7fB0LKDNo= -github.com/lightninglabs/lndclient v0.20.0-1/go.mod h1:LcbsTCCd0Qw5C4zlv/YqrPY81XUVA6wN1lA/qEWIs+Y= github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2 h1:eFjp1dIB2BhhQp/THKrjLdlYuPugO9UU4kDqu91OX/Q= github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2/go.mod h1:99BKpIi6ruaaXRM1A77eqZ+FWPQ3cfRa+ZVy5bmWMaY= github.com/lightninglabs/neutrino v0.16.1 h1:5Kz4ToxncEVkpKC6fwUjXKtFKJhuxlG3sBB3MdJTJjs= @@ -1288,6 +1286,8 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/starius/lndclient v0.20.0-1-ports.0.20251110204322-be4fd2c52ae3 h1:3KLh1JqXWShhBRsdEOjEs1DfAwd8BNk2YYnTW88B5yw= +github.com/starius/lndclient v0.20.0-1-ports.0.20251110204322-be4fd2c52ae3/go.mod h1:VxIakyBmTIy4tmg2zqj45YrDkJi53PQLwW0lmFzRR6k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= diff --git a/loopin_testcontext_test.go b/loopin_testcontext_test.go index cc48990a7..bc566b60b 100644 --- a/loopin_testcontext_test.go +++ b/loopin_testcontext_test.go @@ -82,7 +82,9 @@ func (c *loopInTestContext) updateInvoiceState(amount btcutil.Amount, c.swapInvoiceSubscription.Update <- lndclient.InvoiceUpdate{ AmtPaid: amount, - State: state, + Invoice: lndclient.Invoice{ + State: state, + }, } // If we're in a final state, close our update channels as lndclient diff --git a/server_mock_test.go b/server_mock_test.go index 43abf6489..4baceb64b 100644 --- a/server_mock_test.go +++ b/server_mock_test.go @@ -181,7 +181,9 @@ func (s *serverMock) NewLoopInSwap(_ context.Context, swapHash lntypes.Hash, // cancel the probe payment. probeSub := <-s.lnd.SingleInvoiceSubcribeChannel probeSub.Update <- lndclient.InvoiceUpdate{ - State: invpkg.ContractAccepted, + Invoice: lndclient.Invoice{ + State: invpkg.ContractAccepted, + }, } <-s.lnd.FailInvoiceChannel From 0b53957c74d13aa445337504d097100704ef372e Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 10 Nov 2025 17:45:11 -0300 Subject: [PATCH 2/2] loopd: wait for chain notifier Use https://github.com/lightninglabs/lndclient/pull/255 --- loopd/run.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/loopd/run.go b/loopd/run.go index e3fd16255..0735d29af 100644 --- a/loopd/run.go +++ b/loopd/run.go @@ -88,15 +88,17 @@ func NewListenerConfig(config *Config, rpcCfg RPCConfig) *ListenerCfg { defer cancel() svcCfg := &lndclient.LndServicesConfig{ - LndAddress: cfg.Host, - Network: network, - CustomMacaroonPath: cfg.MacaroonPath, - TLSPath: cfg.TLSPath, - CheckVersion: LoopMinRequiredLndVersion, - BlockUntilChainSynced: true, - CallerCtx: callerCtx, - BlockUntilUnlocked: true, - RPCTimeout: cfg.RPCTimeout, + LndAddress: cfg.Host, + Network: network, + CustomMacaroonPath: cfg.MacaroonPath, + TLSPath: cfg.TLSPath, + CheckVersion: LoopMinRequiredLndVersion, + CallerCtx: callerCtx, + RPCTimeout: cfg.RPCTimeout, + + BlockUntilChainSynced: true, + BlockUntilUnlocked: true, + BlockUntilChainNotifier: true, } // If a custom lnd connection is specified we use that