@@ -12,7 +12,6 @@ import (
12
12
"github.com/btcsuite/btcd/btcutil"
13
13
"github.com/btcsuite/btcd/chaincfg/chainhash"
14
14
"github.com/btcsuite/btcd/wire"
15
- "github.com/davecgh/go-spew/spew"
16
15
proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
17
16
"github.com/lightninglabs/lndclient"
18
17
"github.com/lightninglabs/taproot-assets/address"
@@ -34,6 +33,7 @@ import (
34
33
"github.com/lightningnetwork/lnd/lncfg"
35
34
"github.com/lightningnetwork/lnd/lnrpc"
36
35
"github.com/lightningnetwork/lnd/lntypes"
36
+ "github.com/lightningnetwork/lnd/lnutils"
37
37
"github.com/lightningnetwork/lnd/lnwallet"
38
38
lnwl "github.com/lightningnetwork/lnd/lnwallet"
39
39
"github.com/lightningnetwork/lnd/lnwallet/chancloser"
@@ -997,16 +997,19 @@ func (s *Server) ChannelFinalized(pid funding.PendingChanID) error {
997
997
//
998
998
// NOTE: This method is part of the routing.TlvTrafficShaper interface.
999
999
func (s * Server ) ShouldHandleTraffic (cid lnwire.ShortChannelID ,
1000
- fundingBlob lfn.Option [tlv.Blob ]) (bool , error ) {
1000
+ fundingBlob , htlcBlob lfn.Option [tlv.Blob ]) (bool , error ) {
1001
1001
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 ))
1004
1005
1005
1006
if err := s .waitForReady (); err != nil {
1006
1007
return false , err
1007
1008
}
1008
1009
1009
- return s .cfg .AuxTrafficShaper .ShouldHandleTraffic (cid , fundingBlob )
1010
+ return s .cfg .AuxTrafficShaper .ShouldHandleTraffic (
1011
+ cid , fundingBlob , htlcBlob ,
1012
+ )
1010
1013
}
1011
1014
1012
1015
// PaymentBandwidth returns the available bandwidth for a custom channel decided
@@ -1016,20 +1019,23 @@ func (s *Server) ShouldHandleTraffic(cid lnwire.ShortChannelID,
1016
1019
// called first.
1017
1020
//
1018
1021
// 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 ,
1021
1025
htlcView lnwallet.AuxHtlcView ) (lnwire.MilliSatoshi , error ) {
1022
1026
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 ))
1026
1031
1027
1032
if err := s .waitForReady (); err != nil {
1028
1033
return 0 , err
1029
1034
}
1030
1035
1031
1036
return s .cfg .AuxTrafficShaper .PaymentBandwidth (
1032
- htlcBlob , commitmentBlob , linkBandwidth , htlcAmt , htlcView ,
1037
+ fundingBlob , htlcBlob , commitmentBlob , linkBandwidth , htlcAmt ,
1038
+ htlcView ,
1033
1039
)
1034
1040
}
1035
1041
@@ -1043,7 +1049,8 @@ func (s *Server) ProduceHtlcExtraData(totalAmount lnwire.MilliSatoshi,
1043
1049
lnwire.CustomRecords , error ) {
1044
1050
1045
1051
srvrLog .Debugf ("ProduceHtlcExtraData called, totalAmount=%d, " +
1046
- "htlcBlob=%v" , totalAmount , spew .Sdump (htlcCustomRecords ))
1052
+ "htlcBlob=%v" , totalAmount ,
1053
+ lnutils .SpewLogClosure (htlcCustomRecords ))
1047
1054
1048
1055
if err := s .waitForReady (); err != nil {
1049
1056
return 0 , nil , err
@@ -1074,7 +1081,8 @@ func (s *Server) AuxCloseOutputs(
1074
1081
desc chancloser.AuxCloseDesc ) (lfn.Option [chancloser.AuxCloseOutputs ],
1075
1082
error ) {
1076
1083
1077
- srvrLog .Tracef ("AuxCloseOutputs called, desc=%v" , spew .Sdump (desc ))
1084
+ srvrLog .Tracef ("AuxCloseOutputs called, desc=%v" ,
1085
+ lnutils .SpewLogClosure (desc ))
1078
1086
1079
1087
if err := s .waitForReady (); err != nil {
1080
1088
return lfn .None [chancloser.AuxCloseOutputs ](), err
@@ -1091,7 +1099,8 @@ func (s *Server) ShutdownBlob(
1091
1099
req chancloser.AuxShutdownReq ) (lfn.Option [lnwire.CustomRecords ],
1092
1100
error ) {
1093
1101
1094
- srvrLog .Tracef ("ShutdownBlob called, req=%v" , spew .Sdump (req ))
1102
+ srvrLog .Tracef ("ShutdownBlob called, req=%v" ,
1103
+ lnutils .SpewLogClosure (req ))
1095
1104
1096
1105
if err := s .waitForReady (); err != nil {
1097
1106
return lfn .None [lnwire.CustomRecords ](), err
@@ -1109,7 +1118,7 @@ func (s *Server) FinalizeClose(desc chancloser.AuxCloseDesc,
1109
1118
closeTx * wire.MsgTx ) error {
1110
1119
1111
1120
srvrLog .Tracef ("FinalizeClose called, desc=%v, closeTx=%v" ,
1112
- spew . Sdump (desc ), spew . Sdump (closeTx ))
1121
+ lnutils . SpewLogClosure (desc ), lnutils . SpewLogClosure (closeTx ))
1113
1122
1114
1123
if err := s .waitForReady (); err != nil {
1115
1124
return err
@@ -1123,7 +1132,8 @@ func (s *Server) FinalizeClose(desc chancloser.AuxCloseDesc,
1123
1132
//
1124
1133
// NOTE: This method is part of the lnwallet.AuxContractResolver interface.
1125
1134
func (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 ))
1127
1137
1128
1138
if err := s .waitForReady (); err != nil {
1129
1139
return lfn.Err [tlv.Blob ](err )
@@ -1141,7 +1151,7 @@ func (s *Server) DeriveSweepAddr(inputs []input.Input,
1141
1151
change lnwl.AddrWithKey ) lfn.Result [sweep.SweepOutput ] {
1142
1152
1143
1153
srvrLog .Tracef ("DeriveSweepAddr called, inputs=%v, change=%v" ,
1144
- spew . Sdump (inputs ), spew . Sdump (change ))
1154
+ lnutils . SpewLogClosure (inputs ), lnutils . SpewLogClosure (change ))
1145
1155
1146
1156
if err := s .waitForReady (); err != nil {
1147
1157
return lfn.Err [sweep.SweepOutput ](err )
@@ -1158,7 +1168,7 @@ func (s *Server) ExtraBudgetForInputs(
1158
1168
inputs []input.Input ) lfn.Result [btcutil.Amount ] {
1159
1169
1160
1170
srvrLog .Tracef ("ExtraBudgetForInputs called, inputs=%v" ,
1161
- spew . Sdump (inputs ))
1171
+ lnutils . SpewLogClosure (inputs ))
1162
1172
1163
1173
if err := s .waitForReady (); err != nil {
1164
1174
return lfn.Err [btcutil.Amount ](err )
@@ -1176,8 +1186,9 @@ func (s *Server) NotifyBroadcast(req *sweep.BumpRequest,
1176
1186
outpointToTxIndex map [wire.OutPoint ]int ) error {
1177
1187
1178
1188
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 ))
1181
1192
1182
1193
if err := s .waitForReady (); err != nil {
1183
1194
return err
0 commit comments