Skip to content
Merged
25 changes: 25 additions & 0 deletions asset/asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
"bytes"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"os"
"path/filepath"
"reflect"
"testing"

Expand Down Expand Up @@ -106,6 +109,8 @@ var (
GroupPubKey: *pubKey,
},
}

assetHexFileName = filepath.Join("testdata", "asset.hex")
)

// TestGenesisAssetClassification tests that the multiple forms of genesis asset
Expand Down Expand Up @@ -1222,3 +1227,23 @@ func TestExternalKeyPubKey(t *testing.T) {
})
}
}

// TestDecodeAsset tests that we can decode an asset from a hex file. This is
// mostly useful for debugging purposes.
func TestDecodeAsset(t *testing.T) {
fileContent, err := os.ReadFile(assetHexFileName)
require.NoError(t, err)

assetBytes, err := hex.DecodeString(string(fileContent))
require.NoError(t, err)

var a Asset
err = a.Decode(bytes.NewReader(assetBytes))
require.NoError(t, err)

ta := NewTestFromAsset(t, &a)
assetJSON, err := json.MarshalIndent(ta, "", "\t")
require.NoError(t, err)

t.Logf("Decoded asset: %v", string(assetJSON))
}
1 change: 1 addition & 0 deletions asset/testdata/asset.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0001010265fca6685a399ad7e9088ba3911c5b2f02b07cffc319f8086e3f129fbf647c4537000000011b69746573742d61737365742d63656e74732d7472616e6368652d32811ad3c42f355c915d1fc4ba4ed71337092191431308f975d7acbc88a09ab98100000000000401000603fd138a0901040bad01ab01651145af966796fc5f4e7ec057acd24b38c5d0060bfe8e0c74e4c9464c08993a330000000017e137755dac067b0e1d91e33d077ab3482fbe1c382d424412c4620a8e3455eb02e9fa4e023746d43a7440b4148fb00f83f8b22ecb67625313fcb54442df2bdfb403420140791e35d3b49d0c1a1ec6415ba419f027fb4fcf254773e9c54ba77715a793e33c67175901e020b9ed87ab2161aa17a572def28d638ca3656fd5f27d6fd974ae280e020000102102e9fa4e023746d43a7440b4148fb00f83f8b22ecb67625313fcb54442df2bdfb4112102f37e9d09521076209768a6028aa2b42000b042a0635cb90f257c8b00c34a3688
6 changes: 3 additions & 3 deletions docs/examples/basic-price-oracle/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/lndclient v0.19.0-3 // indirect
github.com/lightninglabs/lndclient v0.19.0-4 // indirect
github.com/lightninglabs/neutrino v0.16.1 // indirect
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250417120008-a304be6bad91 // indirect
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af // indirect
github.com/lightningnetwork/lnd/cert v1.2.2 // indirect
github.com/lightningnetwork/lnd/clock v1.1.1 // indirect
github.com/lightningnetwork/lnd/fn/v2 v2.0.8 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.15 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.16 // indirect
github.com/lightningnetwork/lnd/queue v1.1.1 // indirect
github.com/lightningnetwork/lnd/sqldb v1.0.9 // indirect
github.com/lightningnetwork/lnd/ticker v1.1.1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions docs/examples/basic-price-oracle/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQ
github.com/lightninglabs/lightning-node-connect v0.2.5-alpha h1:ZRVChwczFXK0CEbxOCWwUA6TIZvrkE0APd1T3WjFAwg=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 h1:Er1miPZD2XZwcfE4xoS5AILqP1mj7kqnhbBSxW9BDxY=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4=
github.com/lightninglabs/lndclient v0.19.0-3 h1:PGGlDaz8x1dXGowDfAWhbuDqXTKNaJyb7SOTrRdG1es=
github.com/lightninglabs/lndclient v0.19.0-3/go.mod h1:5YMrFx00NvcmUHGZRxT4Qw/gOfR5x50/ReJmJ6w0yVk=
github.com/lightninglabs/lndclient v0.19.0-4 h1:U+koisg716/i51kf5ENI5+9a1joXcPXeJYl3q0s4/co=
github.com/lightninglabs/lndclient v0.19.0-4/go.mod h1:LP3FM3JGBdvOX8Lum9x1r7q54oiftoqaq4EYhtpp/fk=
github.com/lightninglabs/neutrino v0.16.1 h1:5Kz4ToxncEVkpKC6fwUjXKtFKJhuxlG3sBB3MdJTJjs=
github.com/lightninglabs/neutrino v0.16.1/go.mod h1:L+5UAccpUdyM7yDgmQySgixf7xmwBgJtOfs/IP26jCs=
github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g=
Expand All @@ -448,8 +448,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250417120008-a304be6bad91 h1:LzLA7+J/fP1VrK4BcyAt86cg4/bkfY38gYRBJoy109o=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250417120008-a304be6bad91/go.mod h1:v4Y0gLAIqqxY83J+4HilQHIiScIy2ok2GSuBFtoc1zc=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af h1:+t8N7kmI7YVu7Hzv8pPiMVCTjnSRi/qOxbAkXa5rn+0=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af/go.mod h1:nCkZ6G6twxDKn31117M0BNfN5JSAmJVAHNTwYrn31BQ=
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
Expand All @@ -458,8 +458,8 @@ github.com/lightningnetwork/lnd/fn/v2 v2.0.8 h1:r2SLz7gZYQPVc3IZhU82M66guz3Zk2oY
github.com/lightningnetwork/lnd/fn/v2 v2.0.8/go.mod h1:TOzwrhjB/Azw1V7aa8t21ufcQmdsQOQMDtxVOQWNl8s=
github.com/lightningnetwork/lnd/healthcheck v1.2.6 h1:1sWhqr93GdkWy4+6U7JxBfcyZIE78MhIHTJZfPx7qqI=
github.com/lightningnetwork/lnd/healthcheck v1.2.6/go.mod h1:Mu02um4CWY/zdTOvFje7WJgJcHyX2zq/FG3MhOAiGaQ=
github.com/lightningnetwork/lnd/kvdb v1.4.15 h1:3eN6uGcubvGB5itPp1D0D4uEEkIMYht3w0LDnqLzAWI=
github.com/lightningnetwork/lnd/kvdb v1.4.15/go.mod h1:HW+bvwkxNaopkz3oIgBV6NEnV4jCEZCACFUcNg4xSjM=
github.com/lightningnetwork/lnd/kvdb v1.4.16 h1:9BZgWdDfjmHRHLS97cz39bVuBAqMc4/p3HX1xtUdbDI=
github.com/lightningnetwork/lnd/kvdb v1.4.16/go.mod h1:HW+bvwkxNaopkz3oIgBV6NEnV4jCEZCACFUcNg4xSjM=
github.com/lightningnetwork/lnd/queue v1.1.1 h1:99ovBlpM9B0FRCGYJo6RSFDlt8/vOkQQZznVb18iNMI=
github.com/lightningnetwork/lnd/queue v1.1.1/go.mod h1:7A6nC1Qrm32FHuhx/mi1cieAiBZo5O6l8IBIoQxvkz4=
github.com/lightningnetwork/lnd/sqldb v1.0.9 h1:7OHi+Hui823mB/U9NzCdlZTAGSVdDCbjp33+6d/Q+G0=
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ require (
github.com/lib/pq v1.10.9
github.com/lightninglabs/aperture v0.3.8-beta
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2
github.com/lightninglabs/lndclient v0.19.0-3
github.com/lightninglabs/lndclient v0.19.0-4
github.com/lightninglabs/neutrino/cache v1.1.2
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250417120008-a304be6bad91
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
github.com/lightningnetwork/lnd/fn/v2 v2.0.8
Expand Down Expand Up @@ -127,7 +127,7 @@ require (
github.com/lightninglabs/neutrino v0.16.1 // indirect
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.15 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.16 // indirect
github.com/lightningnetwork/lnd/queue v1.1.1 // indirect
github.com/lightningnetwork/lnd/sqldb v1.0.9 // indirect
github.com/lightningnetwork/lnd/ticker v1.1.1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ github.com/lightninglabs/lightning-node-connect v0.2.5-alpha h1:ZRVChwczFXK0CEbx
github.com/lightninglabs/lightning-node-connect v0.2.5-alpha/go.mod h1:A9Pof9fETkH+F67BnOmrBDThPKstqp73wlImWOZvTXQ=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 h1:Er1miPZD2XZwcfE4xoS5AILqP1mj7kqnhbBSxW9BDxY=
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2/go.mod h1:antQGRDRJiuyQF6l+k6NECCSImgCpwaZapATth2Chv4=
github.com/lightninglabs/lndclient v0.19.0-3 h1:PGGlDaz8x1dXGowDfAWhbuDqXTKNaJyb7SOTrRdG1es=
github.com/lightninglabs/lndclient v0.19.0-3/go.mod h1:5YMrFx00NvcmUHGZRxT4Qw/gOfR5x50/ReJmJ6w0yVk=
github.com/lightninglabs/lndclient v0.19.0-4 h1:U+koisg716/i51kf5ENI5+9a1joXcPXeJYl3q0s4/co=
github.com/lightninglabs/lndclient v0.19.0-4/go.mod h1:LP3FM3JGBdvOX8Lum9x1r7q54oiftoqaq4EYhtpp/fk=
github.com/lightninglabs/neutrino v0.16.1 h1:5Kz4ToxncEVkpKC6fwUjXKtFKJhuxlG3sBB3MdJTJjs=
github.com/lightninglabs/neutrino v0.16.1/go.mod h1:L+5UAccpUdyM7yDgmQySgixf7xmwBgJtOfs/IP26jCs=
github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g=
Expand All @@ -502,8 +502,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250417120008-a304be6bad91 h1:LzLA7+J/fP1VrK4BcyAt86cg4/bkfY38gYRBJoy109o=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250417120008-a304be6bad91/go.mod h1:v4Y0gLAIqqxY83J+4HilQHIiScIy2ok2GSuBFtoc1zc=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af h1:+t8N7kmI7YVu7Hzv8pPiMVCTjnSRi/qOxbAkXa5rn+0=
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af/go.mod h1:nCkZ6G6twxDKn31117M0BNfN5JSAmJVAHNTwYrn31BQ=
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
Expand All @@ -512,8 +512,8 @@ github.com/lightningnetwork/lnd/fn/v2 v2.0.8 h1:r2SLz7gZYQPVc3IZhU82M66guz3Zk2oY
github.com/lightningnetwork/lnd/fn/v2 v2.0.8/go.mod h1:TOzwrhjB/Azw1V7aa8t21ufcQmdsQOQMDtxVOQWNl8s=
github.com/lightningnetwork/lnd/healthcheck v1.2.6 h1:1sWhqr93GdkWy4+6U7JxBfcyZIE78MhIHTJZfPx7qqI=
github.com/lightningnetwork/lnd/healthcheck v1.2.6/go.mod h1:Mu02um4CWY/zdTOvFje7WJgJcHyX2zq/FG3MhOAiGaQ=
github.com/lightningnetwork/lnd/kvdb v1.4.15 h1:3eN6uGcubvGB5itPp1D0D4uEEkIMYht3w0LDnqLzAWI=
github.com/lightningnetwork/lnd/kvdb v1.4.15/go.mod h1:HW+bvwkxNaopkz3oIgBV6NEnV4jCEZCACFUcNg4xSjM=
github.com/lightningnetwork/lnd/kvdb v1.4.16 h1:9BZgWdDfjmHRHLS97cz39bVuBAqMc4/p3HX1xtUdbDI=
github.com/lightningnetwork/lnd/kvdb v1.4.16/go.mod h1:HW+bvwkxNaopkz3oIgBV6NEnV4jCEZCACFUcNg4xSjM=
github.com/lightningnetwork/lnd/queue v1.1.1 h1:99ovBlpM9B0FRCGYJo6RSFDlt8/vOkQQZznVb18iNMI=
github.com/lightningnetwork/lnd/queue v1.1.1/go.mod h1:7A6nC1Qrm32FHuhx/mi1cieAiBZo5O6l8IBIoQxvkz4=
github.com/lightningnetwork/lnd/sqldb v1.0.9 h1:7OHi+Hui823mB/U9NzCdlZTAGSVdDCbjp33+6d/Q+G0=
Expand Down
35 changes: 35 additions & 0 deletions rfqmsg/custom_channel_data.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package rfqmsg

import (
"strings"

"github.com/lightninglabs/taproot-assets/asset"
"github.com/lightninglabs/taproot-assets/fn"
)

// JsonAssetBalance is a struct that represents the balance of a single asset ID
// within a channel.
type JsonAssetBalance struct {
Expand Down Expand Up @@ -37,12 +44,40 @@ type JsonAssetChannel struct {
OutgoingHtlcs []JsonAssetTranche `json:"outgoing_htlcs"`
IncomingHtlcs []JsonAssetTranche `json:"incoming_htlcs"`
Capacity uint64 `json:"capacity"`
GroupKey string `json:"group_key,omitempty"`
LocalBalance uint64 `json:"local_balance"`
RemoteBalance uint64 `json:"remote_balance"`
OutgoingHtlcBalance uint64 `json:"outgoing_htlc_balance"`
IncomingHtlcBalance uint64 `json:"incoming_htlc_balance"`
}

// HasAllAssetIDs checks if the OpenChannel contains all asset IDs in the
// provided set. It returns true if all asset IDs are present, false otherwise.
func (c *JsonAssetChannel) HasAllAssetIDs(ids fn.Set[asset.ID]) bool {
// There is a possibility that we're checking the asset ID from an HTLC
// that hasn't been materialized yet and could actually contain a group
// key x-coordinate. That should only be the case if there is a single
// asset ID.
if len(ids) == 1 && c.GroupKey != "" {
assetID := ids.ToSlice()[0]
if strings.Contains(c.GroupKey, assetID.String()) {
return true
}
}

availableIDStrings := fn.NewSet(fn.Map(
c.FundingAssets, func(fundingAsset JsonAssetUtxo) string {
return fundingAsset.AssetGenesis.AssetID
},
)...)
targetIDStrings := fn.NewSet(fn.Map(
ids.ToSlice(), func(id asset.ID) string {
return id.String()
},
)...)
return targetIDStrings.Subset(availableIDStrings)
}

// JsonAssetChannelBalances is a struct that represents the balance information
// of all assets within open and pending channels.
type JsonAssetChannelBalances struct {
Expand Down
51 changes: 31 additions & 20 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/davecgh/go-spew/spew"
proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/taproot-assets/address"
Expand All @@ -34,6 +33,7 @@ import (
"github.com/lightningnetwork/lnd/lncfg"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnutils"
"github.com/lightningnetwork/lnd/lnwallet"
lnwl "github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
Expand Down Expand Up @@ -997,16 +997,19 @@ func (s *Server) ChannelFinalized(pid funding.PendingChanID) error {
//
// NOTE: This method is part of the routing.TlvTrafficShaper interface.
func (s *Server) ShouldHandleTraffic(cid lnwire.ShortChannelID,
fundingBlob lfn.Option[tlv.Blob]) (bool, error) {
fundingBlob, htlcBlob lfn.Option[tlv.Blob]) (bool, error) {

srvrLog.Debugf("HandleTraffic called (cid=%v, fundingBlob=%x)", cid,
fundingBlob.UnwrapOr(tlv.Blob{}))
srvrLog.Debugf("HandleTraffic called, cid=%v, fundingBlob=%v, "+
"htlcBlob=%v", cid, lnutils.SpewLogClosure(fundingBlob),
lnutils.SpewLogClosure(htlcBlob))

if err := s.waitForReady(); err != nil {
return false, err
}

return s.cfg.AuxTrafficShaper.ShouldHandleTraffic(cid, fundingBlob)
return s.cfg.AuxTrafficShaper.ShouldHandleTraffic(
cid, fundingBlob, htlcBlob,
)
}

// PaymentBandwidth returns the available bandwidth for a custom channel decided
Expand All @@ -1016,20 +1019,23 @@ func (s *Server) ShouldHandleTraffic(cid lnwire.ShortChannelID,
// called first.
//
// NOTE: This method is part of the routing.TlvTrafficShaper interface.
func (s *Server) PaymentBandwidth(htlcBlob, commitmentBlob lfn.Option[tlv.Blob],
linkBandwidth, htlcAmt lnwire.MilliSatoshi,
func (s *Server) PaymentBandwidth(fundingBlob, htlcBlob,
commitmentBlob lfn.Option[tlv.Blob], linkBandwidth,
htlcAmt lnwire.MilliSatoshi,
htlcView lnwallet.AuxHtlcView) (lnwire.MilliSatoshi, error) {

srvrLog.Debugf("PaymentBandwidth called, htlcBlob=%v, "+
"commitmentBlob=%v", spew.Sdump(htlcBlob),
spew.Sdump(commitmentBlob))
srvrLog.Debugf("PaymentBandwidth called, fundingBlob=%v, htlcBlob=%v, "+
"commitmentBlob=%v", lnutils.SpewLogClosure(fundingBlob),
lnutils.SpewLogClosure(htlcBlob),
lnutils.SpewLogClosure(commitmentBlob))

if err := s.waitForReady(); err != nil {
return 0, err
}

return s.cfg.AuxTrafficShaper.PaymentBandwidth(
htlcBlob, commitmentBlob, linkBandwidth, htlcAmt, htlcView,
fundingBlob, htlcBlob, commitmentBlob, linkBandwidth, htlcAmt,
htlcView,
)
}

Expand All @@ -1043,7 +1049,8 @@ func (s *Server) ProduceHtlcExtraData(totalAmount lnwire.MilliSatoshi,
lnwire.CustomRecords, error) {

srvrLog.Debugf("ProduceHtlcExtraData called, totalAmount=%d, "+
"htlcBlob=%v", totalAmount, spew.Sdump(htlcCustomRecords))
"htlcBlob=%v", totalAmount,
lnutils.SpewLogClosure(htlcCustomRecords))

if err := s.waitForReady(); err != nil {
return 0, nil, err
Expand Down Expand Up @@ -1074,7 +1081,8 @@ func (s *Server) AuxCloseOutputs(
desc chancloser.AuxCloseDesc) (lfn.Option[chancloser.AuxCloseOutputs],
error) {

srvrLog.Tracef("AuxCloseOutputs called, desc=%v", spew.Sdump(desc))
srvrLog.Tracef("AuxCloseOutputs called, desc=%v",
lnutils.SpewLogClosure(desc))

if err := s.waitForReady(); err != nil {
return lfn.None[chancloser.AuxCloseOutputs](), err
Expand All @@ -1091,7 +1099,8 @@ func (s *Server) ShutdownBlob(
req chancloser.AuxShutdownReq) (lfn.Option[lnwire.CustomRecords],
error) {

srvrLog.Tracef("ShutdownBlob called, req=%v", spew.Sdump(req))
srvrLog.Tracef("ShutdownBlob called, req=%v",
lnutils.SpewLogClosure(req))

if err := s.waitForReady(); err != nil {
return lfn.None[lnwire.CustomRecords](), err
Expand All @@ -1109,7 +1118,7 @@ func (s *Server) FinalizeClose(desc chancloser.AuxCloseDesc,
closeTx *wire.MsgTx) error {

srvrLog.Tracef("FinalizeClose called, desc=%v, closeTx=%v",
spew.Sdump(desc), spew.Sdump(closeTx))
lnutils.SpewLogClosure(desc), lnutils.SpewLogClosure(closeTx))

if err := s.waitForReady(); err != nil {
return err
Expand All @@ -1123,7 +1132,8 @@ func (s *Server) FinalizeClose(desc chancloser.AuxCloseDesc,
//
// NOTE: This method is part of the lnwallet.AuxContractResolver interface.
func (s *Server) ResolveContract(req lnwl.ResolutionReq) lfn.Result[tlv.Blob] {
srvrLog.Tracef("ResolveContract called, req=%v", spew.Sdump(req))
srvrLog.Tracef("ResolveContract called, req=%v",
lnutils.SpewLogClosure(req))

if err := s.waitForReady(); err != nil {
return lfn.Err[tlv.Blob](err)
Expand All @@ -1141,7 +1151,7 @@ func (s *Server) DeriveSweepAddr(inputs []input.Input,
change lnwl.AddrWithKey) lfn.Result[sweep.SweepOutput] {

srvrLog.Tracef("DeriveSweepAddr called, inputs=%v, change=%v",
spew.Sdump(inputs), spew.Sdump(change))
lnutils.SpewLogClosure(inputs), lnutils.SpewLogClosure(change))

if err := s.waitForReady(); err != nil {
return lfn.Err[sweep.SweepOutput](err)
Expand All @@ -1158,7 +1168,7 @@ func (s *Server) ExtraBudgetForInputs(
inputs []input.Input) lfn.Result[btcutil.Amount] {

srvrLog.Tracef("ExtraBudgetForInputs called, inputs=%v",
spew.Sdump(inputs))
lnutils.SpewLogClosure(inputs))

if err := s.waitForReady(); err != nil {
return lfn.Err[btcutil.Amount](err)
Expand All @@ -1176,8 +1186,9 @@ func (s *Server) NotifyBroadcast(req *sweep.BumpRequest,
outpointToTxIndex map[wire.OutPoint]int) error {

srvrLog.Tracef("NotifyBroadcast called, req=%v, tx=%v, fee=%v, "+
"out_index=%v", spew.Sdump(req), spew.Sdump(tx), fee,
spew.Sdump(outpointToTxIndex))
"out_index=%v", lnutils.SpewLogClosure(req),
lnutils.SpewLogClosure(tx), fee,
lnutils.SpewLogClosure(outpointToTxIndex))

if err := s.waitForReady(); err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions tapcfg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
ChainParams: &tapChainParams,
InvoiceHtlcModifier: lndInvoicesClient,
RfqManager: rfqManager,
LightningClient: lndServices.Client,
},
)
auxChanCloser := tapchannel.NewAuxChanCloser(
Expand Down
Loading
Loading