@@ -12,7 +12,6 @@ import (
1212 "github.com/btcsuite/btcd/btcutil"
1313 "github.com/btcsuite/btcd/chaincfg/chainhash"
1414 "github.com/btcsuite/btcd/wire"
15- "github.com/davecgh/go-spew/spew"
1615 proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
1716 "github.com/lightninglabs/lndclient"
1817 "github.com/lightninglabs/taproot-assets/address"
@@ -34,6 +33,7 @@ import (
3433 "github.com/lightningnetwork/lnd/lncfg"
3534 "github.com/lightningnetwork/lnd/lnrpc"
3635 "github.com/lightningnetwork/lnd/lntypes"
36+ "github.com/lightningnetwork/lnd/lnutils"
3737 "github.com/lightningnetwork/lnd/lnwallet"
3838 lnwl "github.com/lightningnetwork/lnd/lnwallet"
3939 "github.com/lightningnetwork/lnd/lnwallet/chancloser"
@@ -997,16 +997,19 @@ func (s *Server) ChannelFinalized(pid funding.PendingChanID) error {
997997//
998998// NOTE: This method is part of the routing.TlvTrafficShaper interface.
999999func (s * Server ) ShouldHandleTraffic (cid lnwire.ShortChannelID ,
1000- fundingBlob lfn.Option [tlv.Blob ]) (bool , error ) {
1000+ fundingBlob , htlcBlob lfn.Option [tlv.Blob ]) (bool , error ) {
10011001
1002- srvrLog .Debugf ("HandleTraffic called (cid=%v, fundingBlob=%x)" , cid ,
1003- fundingBlob .UnwrapOr (tlv.Blob {}))
1002+ srvrLog .Debugf ("HandleTraffic called, cid=%v, fundingBlob=%v, " +
1003+ "htlcBlob=%v" , cid , lnutils .SpewLogClosure (fundingBlob ),
1004+ lnutils .SpewLogClosure (htlcBlob ))
10041005
10051006 if err := s .waitForReady (); err != nil {
10061007 return false , err
10071008 }
10081009
1009- return s .cfg .AuxTrafficShaper .ShouldHandleTraffic (cid , fundingBlob )
1010+ return s .cfg .AuxTrafficShaper .ShouldHandleTraffic (
1011+ cid , fundingBlob , htlcBlob ,
1012+ )
10101013}
10111014
10121015// PaymentBandwidth returns the available bandwidth for a custom channel decided
@@ -1016,20 +1019,23 @@ func (s *Server) ShouldHandleTraffic(cid lnwire.ShortChannelID,
10161019// called first.
10171020//
10181021// NOTE: This method is part of the routing.TlvTrafficShaper interface.
1019- func (s * Server ) PaymentBandwidth (htlcBlob , commitmentBlob lfn.Option [tlv.Blob ],
1020- linkBandwidth , htlcAmt lnwire.MilliSatoshi ,
1022+ func (s * Server ) PaymentBandwidth (fundingBlob , htlcBlob ,
1023+ commitmentBlob lfn.Option [tlv.Blob ], linkBandwidth ,
1024+ htlcAmt lnwire.MilliSatoshi ,
10211025 htlcView lnwallet.AuxHtlcView ) (lnwire.MilliSatoshi , error ) {
10221026
1023- srvrLog .Debugf ("PaymentBandwidth called, htlcBlob=%v, " +
1024- "commitmentBlob=%v" , spew .Sdump (htlcBlob ),
1025- spew .Sdump (commitmentBlob ))
1027+ srvrLog .Debugf ("PaymentBandwidth called, fundingBlob=%v, htlcBlob=%v, " +
1028+ "commitmentBlob=%v" , lnutils .SpewLogClosure (fundingBlob ),
1029+ lnutils .SpewLogClosure (htlcBlob ),
1030+ lnutils .SpewLogClosure (commitmentBlob ))
10261031
10271032 if err := s .waitForReady (); err != nil {
10281033 return 0 , err
10291034 }
10301035
10311036 return s .cfg .AuxTrafficShaper .PaymentBandwidth (
1032- htlcBlob , commitmentBlob , linkBandwidth , htlcAmt , htlcView ,
1037+ fundingBlob , htlcBlob , commitmentBlob , linkBandwidth , htlcAmt ,
1038+ htlcView ,
10331039 )
10341040}
10351041
@@ -1043,7 +1049,8 @@ func (s *Server) ProduceHtlcExtraData(totalAmount lnwire.MilliSatoshi,
10431049 lnwire.CustomRecords , error ) {
10441050
10451051 srvrLog .Debugf ("ProduceHtlcExtraData called, totalAmount=%d, " +
1046- "htlcBlob=%v" , totalAmount , spew .Sdump (htlcCustomRecords ))
1052+ "htlcBlob=%v" , totalAmount ,
1053+ lnutils .SpewLogClosure (htlcCustomRecords ))
10471054
10481055 if err := s .waitForReady (); err != nil {
10491056 return 0 , nil , err
@@ -1074,7 +1081,8 @@ func (s *Server) AuxCloseOutputs(
10741081 desc chancloser.AuxCloseDesc ) (lfn.Option [chancloser.AuxCloseOutputs ],
10751082 error ) {
10761083
1077- srvrLog .Tracef ("AuxCloseOutputs called, desc=%v" , spew .Sdump (desc ))
1084+ srvrLog .Tracef ("AuxCloseOutputs called, desc=%v" ,
1085+ lnutils .SpewLogClosure (desc ))
10781086
10791087 if err := s .waitForReady (); err != nil {
10801088 return lfn .None [chancloser.AuxCloseOutputs ](), err
@@ -1091,7 +1099,8 @@ func (s *Server) ShutdownBlob(
10911099 req chancloser.AuxShutdownReq ) (lfn.Option [lnwire.CustomRecords ],
10921100 error ) {
10931101
1094- srvrLog .Tracef ("ShutdownBlob called, req=%v" , spew .Sdump (req ))
1102+ srvrLog .Tracef ("ShutdownBlob called, req=%v" ,
1103+ lnutils .SpewLogClosure (req ))
10951104
10961105 if err := s .waitForReady (); err != nil {
10971106 return lfn .None [lnwire.CustomRecords ](), err
@@ -1109,7 +1118,7 @@ func (s *Server) FinalizeClose(desc chancloser.AuxCloseDesc,
11091118 closeTx * wire.MsgTx ) error {
11101119
11111120 srvrLog .Tracef ("FinalizeClose called, desc=%v, closeTx=%v" ,
1112- spew . Sdump (desc ), spew . Sdump (closeTx ))
1121+ lnutils . SpewLogClosure (desc ), lnutils . SpewLogClosure (closeTx ))
11131122
11141123 if err := s .waitForReady (); err != nil {
11151124 return err
@@ -1123,7 +1132,8 @@ func (s *Server) FinalizeClose(desc chancloser.AuxCloseDesc,
11231132//
11241133// NOTE: This method is part of the lnwallet.AuxContractResolver interface.
11251134func (s * Server ) ResolveContract (req lnwl.ResolutionReq ) lfn.Result [tlv.Blob ] {
1126- srvrLog .Tracef ("ResolveContract called, req=%v" , spew .Sdump (req ))
1135+ srvrLog .Tracef ("ResolveContract called, req=%v" ,
1136+ lnutils .SpewLogClosure (req ))
11271137
11281138 if err := s .waitForReady (); err != nil {
11291139 return lfn.Err [tlv.Blob ](err )
@@ -1141,7 +1151,7 @@ func (s *Server) DeriveSweepAddr(inputs []input.Input,
11411151 change lnwl.AddrWithKey ) lfn.Result [sweep.SweepOutput ] {
11421152
11431153 srvrLog .Tracef ("DeriveSweepAddr called, inputs=%v, change=%v" ,
1144- spew . Sdump (inputs ), spew . Sdump (change ))
1154+ lnutils . SpewLogClosure (inputs ), lnutils . SpewLogClosure (change ))
11451155
11461156 if err := s .waitForReady (); err != nil {
11471157 return lfn.Err [sweep.SweepOutput ](err )
@@ -1158,7 +1168,7 @@ func (s *Server) ExtraBudgetForInputs(
11581168 inputs []input.Input ) lfn.Result [btcutil.Amount ] {
11591169
11601170 srvrLog .Tracef ("ExtraBudgetForInputs called, inputs=%v" ,
1161- spew . Sdump (inputs ))
1171+ lnutils . SpewLogClosure (inputs ))
11621172
11631173 if err := s .waitForReady (); err != nil {
11641174 return lfn.Err [btcutil.Amount ](err )
@@ -1176,8 +1186,9 @@ func (s *Server) NotifyBroadcast(req *sweep.BumpRequest,
11761186 outpointToTxIndex map [wire.OutPoint ]int ) error {
11771187
11781188 srvrLog .Tracef ("NotifyBroadcast called, req=%v, tx=%v, fee=%v, " +
1179- "out_index=%v" , spew .Sdump (req ), spew .Sdump (tx ), fee ,
1180- spew .Sdump (outpointToTxIndex ))
1189+ "out_index=%v" , lnutils .SpewLogClosure (req ),
1190+ lnutils .SpewLogClosure (tx ), fee ,
1191+ lnutils .SpewLogClosure (outpointToTxIndex ))
11811192
11821193 if err := s .waitForReady (); err != nil {
11831194 return err
0 commit comments