Skip to content

Commit fde6732

Browse files
authored
Merge pull request #1236 from lightninglabs/bandwidth-manager-switch
[custom channels]: Fix bandwidth manager and other bugs
2 parents 4a15eb2 + 2ed2772 commit fde6732

File tree

9 files changed

+101
-88
lines changed

9 files changed

+101
-88
lines changed

docs/examples/basic-price-oracle/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ require (
9898
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd // indirect
9999
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
100100
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect
101-
github.com/lightningnetwork/lnd v0.18.4-beta.rc1 // indirect
101+
github.com/lightningnetwork/lnd v0.18.4-beta.rc1.0.20241205204908-f312064bfbd5 // indirect
102102
github.com/lightningnetwork/lnd/clock v1.1.1 // indirect
103103
github.com/lightningnetwork/lnd/fn v1.2.3 // indirect
104104
github.com/lightningnetwork/lnd/healthcheck v1.2.5 // indirect

docs/examples/basic-price-oracle/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS
432432
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
433433
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
434434
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
435-
github.com/lightningnetwork/lnd v0.18.4-beta.rc1 h1:z6hFKvtbfo8udPrIb81GbSoKlUWd06d4LRxTkD19IMQ=
436-
github.com/lightningnetwork/lnd v0.18.4-beta.rc1/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
435+
github.com/lightningnetwork/lnd v0.18.4-beta.rc1.0.20241205204908-f312064bfbd5 h1:YJ/DPJd3YyPWmvv5b74KdpCFi3uBMdmDei54AageGpc=
436+
github.com/lightningnetwork/lnd v0.18.4-beta.rc1.0.20241205204908-f312064bfbd5/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
437437
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
438438
github.com/lightningnetwork/lnd/clock v1.1.1/go.mod h1:mGnAhPyjYZQJmebS7aevElXKTFDuO+uNFFfMXK1W8xQ=
439439
github.com/lightningnetwork/lnd/fn v1.2.3 h1:Q1OrgNSgQynVheBNa16CsKVov1JI5N2AR6G07x9Mles=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2
2929
github.com/lightninglabs/lndclient v0.18.4-7
3030
github.com/lightninglabs/neutrino/cache v1.1.2
31-
github.com/lightningnetwork/lnd v0.18.4-beta.rc1
31+
github.com/lightningnetwork/lnd v0.18.4-beta.rc1.0.20241205204908-f312064bfbd5
3232
github.com/lightningnetwork/lnd/cert v1.2.2
3333
github.com/lightningnetwork/lnd/clock v1.1.1
3434
github.com/lightningnetwork/lnd/fn v1.2.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS
500500
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
501501
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb h1:yfM05S8DXKhuCBp5qSMZdtSwvJ+GFzl94KbXMNB1JDY=
502502
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
503-
github.com/lightningnetwork/lnd v0.18.4-beta.rc1 h1:z6hFKvtbfo8udPrIb81GbSoKlUWd06d4LRxTkD19IMQ=
504-
github.com/lightningnetwork/lnd v0.18.4-beta.rc1/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
503+
github.com/lightningnetwork/lnd v0.18.4-beta.rc1.0.20241205204908-f312064bfbd5 h1:YJ/DPJd3YyPWmvv5b74KdpCFi3uBMdmDei54AageGpc=
504+
github.com/lightningnetwork/lnd v0.18.4-beta.rc1.0.20241205204908-f312064bfbd5/go.mod h1:nPRQzLla5uHPQFyyZn8r9Vgddkd23PBUDa9rggEPOfY=
505505
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
506506
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
507507
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=

rpcserver.go

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6819,13 +6819,9 @@ func marshallRfqEvent(eventInterface fn.Event) (*rfqrpc.RfqEvent, error) {
68196819
}, nil
68206820

68216821
case *rfq.PeerAcceptedSellQuoteEvent:
6822-
rpcAcceptedQuote, err := taprpc.MarshalAcceptedSellQuoteEvent(
6822+
rpcAcceptedQuote := taprpc.MarshalAcceptedSellQuoteEvent(
68236823
event,
68246824
)
6825-
if err != nil {
6826-
return nil, fmt.Errorf("error marshalling accepted "+
6827-
"sell quote event: %w", err)
6828-
}
68296825

68306826
eventRpc := &rfqrpc.RfqEvent_PeerAcceptedSellQuote{
68316827
PeerAcceptedSellQuote: &rfqrpc.PeerAcceptedSellQuoteEvent{
@@ -7036,9 +7032,9 @@ func (r *rpcServer) SendPayment(req *tchrpc.SendPaymentRequest,
70367032
// Continue below.
70377033

70387034
case req.RfqId != nil:
7039-
// Check if the provided rfq ID matches the expected length.
7035+
// Check if the provided RFQ ID matches the expected length.
70407036
if len(req.RfqId) != 32 {
7041-
return fmt.Errorf("rfq must be 32 bytes in length")
7037+
return fmt.Errorf("RFQ ID must be 32 bytes in length")
70427038
}
70437039

70447040
// Now let's try to perform an internal lookup to see if there's
@@ -7061,36 +7057,12 @@ func (r *rpcServer) SendPayment(req *tchrpc.SendPaymentRequest,
70617057
"accepted quote")
70627058
}
70637059

7064-
invoice, err := zpay32.Decode(
7065-
pReq.PaymentRequest, r.cfg.Lnd.ChainParams,
7066-
)
7067-
if err != nil {
7068-
return fmt.Errorf("error decoding payment request: %w",
7069-
err)
7070-
}
7071-
7072-
rate := quote.AssetRate.Rate
7073-
70747060
// Calculate the equivalent asset units for the given invoice
70757061
// amount based on the asset-to-BTC conversion rate.
7076-
numAssetUnits := rfqmath.MilliSatoshiToUnits(
7077-
*invoice.MilliSat, rate,
7078-
)
7079-
7080-
sellOrder := &rfqrpc.PeerAcceptedSellQuote{
7081-
Peer: quote.Peer.String(),
7082-
Id: quote.ID[:],
7083-
Scid: uint64(quote.ID.Scid()),
7084-
BidAssetRate: &rfqrpc.FixedPoint{
7085-
Coefficient: rate.Coefficient.String(),
7086-
Scale: uint32(rate.Scale),
7087-
},
7088-
AssetAmount: numAssetUnits.ToUint64(),
7089-
Expiry: uint64(quote.AssetRate.Expiry.Unix()),
7090-
}
7062+
sellOrder := taprpc.MarshalAcceptedSellQuote(*quote)
70917063

70927064
// Send out the information about the quote on the stream.
7093-
err = stream.Send(&tchrpc.SendPaymentResponse{
7065+
err := stream.Send(&tchrpc.SendPaymentResponse{
70947066
Result: &tchrpc.SendPaymentResponse_AcceptedSellOrder{
70957067
AcceptedSellOrder: sellOrder,
70967068
},
@@ -7101,8 +7073,8 @@ func (r *rpcServer) SendPayment(req *tchrpc.SendPaymentRequest,
71017073
}
71027074

71037075
rpcsLog.Infof("Using quote for %v asset units at %v asset/BTC "+
7104-
"from peer %x with SCID %d", numAssetUnits,
7105-
rate.String(), quote.Peer, quote.ID.Scid())
7076+
"from peer %x with SCID %d", sellOrder.AssetAmount,
7077+
quote.AssetRate.String(), quote.Peer, quote.ID.Scid())
71067078

71077079
htlc := rfqmsg.NewHtlc(nil, fn.Some(quote.ID))
71087080

@@ -7243,15 +7215,9 @@ func (r *rpcServer) SendPayment(req *tchrpc.SendPaymentRequest,
72437215
err)
72447216
}
72457217

7246-
// Calculate the equivalent asset units for the given invoice
7247-
// amount based on the asset-to-BTC conversion rate.
7248-
numAssetUnits := rfqmath.MilliSatoshiToUnits(
7249-
*invoice.MilliSat, *assetRate,
7250-
)
7251-
72527218
rpcsLog.Infof("Got quote for %v asset units at %v asset/BTC "+
7253-
"from peer %x with SCID %d", numAssetUnits, assetRate,
7254-
peerPubKey, acceptedQuote.Scid)
7219+
"from peer %x with SCID %d", acceptedQuote.AssetAmount,
7220+
assetRate, peerPubKey, acceptedQuote.Scid)
72557221

72567222
var rfqID rfqmsg.ID
72577223
copy(rfqID[:], acceptedQuote.Id)

server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/lightningnetwork/lnd/channeldb"
2929
lfn "github.com/lightningnetwork/lnd/fn"
3030
"github.com/lightningnetwork/lnd/funding"
31+
"github.com/lightningnetwork/lnd/htlcswitch"
3132
"github.com/lightningnetwork/lnd/input"
3233
"github.com/lightningnetwork/lnd/lncfg"
3334
"github.com/lightningnetwork/lnd/lnrpc"
@@ -37,7 +38,6 @@ import (
3738
"github.com/lightningnetwork/lnd/lnwire"
3839
"github.com/lightningnetwork/lnd/macaroons"
3940
"github.com/lightningnetwork/lnd/msgmux"
40-
"github.com/lightningnetwork/lnd/routing"
4141
"github.com/lightningnetwork/lnd/sweep"
4242
"github.com/lightningnetwork/lnd/tlv"
4343
"google.golang.org/grpc"
@@ -696,14 +696,14 @@ func (s *Server) Stop() error {
696696

697697
// A compile-time check to ensure that Server fully implements the
698698
// lnwallet.AuxLeafStore, lnd.AuxDataParser, lnwallet.AuxSigner,
699-
// msgmux.Endpoint, funding.AuxFundingController, routing.TlvTrafficShaper
699+
// msgmux.Endpoint, funding.AuxFundingController, htlcswitch.AuxTrafficShaper
700700
// and chancloser.AuxChanCloser interfaces.
701701
var _ lnwl.AuxLeafStore = (*Server)(nil)
702702
var _ lnd.AuxDataParser = (*Server)(nil)
703703
var _ lnwl.AuxSigner = (*Server)(nil)
704704
var _ msgmux.Endpoint = (*Server)(nil)
705705
var _ funding.AuxFundingController = (*Server)(nil)
706-
var _ routing.TlvTrafficShaper = (*Server)(nil)
706+
var _ htlcswitch.AuxTrafficShaper = (*Server)(nil)
707707
var _ chancloser.AuxChanCloser = (*Server)(nil)
708708
var _ lnwl.AuxContractResolver = (*Server)(nil)
709709
var _ sweep.AuxSweeper = (*Server)(nil)

tapchannel/aux_traffic_shaper.go

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212
"github.com/lightninglabs/taproot-assets/rfqmsg"
1313
cmsg "github.com/lightninglabs/taproot-assets/tapchannelmsg"
1414
lfn "github.com/lightningnetwork/lnd/fn"
15+
"github.com/lightningnetwork/lnd/htlcswitch"
1516
"github.com/lightningnetwork/lnd/input"
1617
"github.com/lightningnetwork/lnd/lnwallet"
1718
"github.com/lightningnetwork/lnd/lnwire"
18-
"github.com/lightningnetwork/lnd/routing"
1919
"github.com/lightningnetwork/lnd/tlv"
2020
)
2121

@@ -84,8 +84,8 @@ func (s *AuxTrafficShaper) Stop() error {
8484
}
8585

8686
// A compile-time check to ensure that AuxTrafficShaper fully implements the
87-
// routing.TlvTrafficShaper interface.
88-
var _ routing.TlvTrafficShaper = (*AuxTrafficShaper)(nil)
87+
// htlcswitch.AuxTrafficShaper interface.
88+
var _ htlcswitch.AuxTrafficShaper = (*AuxTrafficShaper)(nil)
8989

9090
// ShouldHandleTraffic is called in order to check if the channel identified by
9191
// the provided channel ID is handled by the traffic shaper implementation. If
@@ -187,8 +187,8 @@ func (s *AuxTrafficShaper) PaymentBandwidth(htlcBlob,
187187
if htlcAssetAmount != 0 && htlcAssetAmount <= localBalance {
188188
// Check if the current link bandwidth can afford sending out
189189
// the htlc amount without dipping into the channel reserve. If
190-
// it goes below the reserve, we report zero bandwdith as we
191-
// cannot push the htlc amount.
190+
// it goes below the reserve, we report zero bandwidth as we
191+
// cannot push the HTLC amount.
192192
if linkBandwidth < htlcAmt {
193193
return 0, nil
194194
}
@@ -213,9 +213,21 @@ func (s *AuxTrafficShaper) PaymentBandwidth(htlcBlob,
213213
// up the accepted quote and determine the outgoing bandwidth in
214214
// satoshis based on the local asset balance.
215215
rfqID := htlc.RfqID.ValOpt().UnsafeFromSome()
216-
acceptedQuotes := s.cfg.RfqManager.PeerAcceptedSellQuotes()
217-
quote, ok := acceptedQuotes[rfqID.Scid()]
218-
if !ok {
216+
acceptedSellQuotes := s.cfg.RfqManager.PeerAcceptedSellQuotes()
217+
acceptedBuyQuotes := s.cfg.RfqManager.LocalAcceptedBuyQuotes()
218+
219+
sellQuote, isSellQuote := acceptedSellQuotes[rfqID.Scid()]
220+
buyQuote, isBuyQuote := acceptedBuyQuotes[rfqID.Scid()]
221+
222+
var rate rfqmsg.AssetRate
223+
switch {
224+
case isSellQuote:
225+
rate = sellQuote.AssetRate
226+
227+
case isBuyQuote:
228+
rate = buyQuote.AssetRate
229+
230+
default:
219231
return 0, fmt.Errorf("no accepted quote found for RFQ ID "+
220232
"%x (SCID %d)", rfqID[:], rfqID.Scid())
221233
}
@@ -224,7 +236,7 @@ func (s *AuxTrafficShaper) PaymentBandwidth(htlcBlob,
224236
// expressed in milli-satoshis.
225237
localBalanceFp := rfqmath.NewBigIntFixedPoint(localBalance, 0)
226238
availableBalanceMsat := rfqmath.UnitsToMilliSatoshi(
227-
localBalanceFp, quote.AssetRate.Rate,
239+
localBalanceFp, rate.Rate,
228240
)
229241

230242
// At this point we have acquired what we need to express the asset

tapchannel/commitment.go

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,20 +363,47 @@ func processAddEntry(htlc *DecodedDescriptor, ourBalance, theirBalance uint64,
363363
// non-dust satoshi balance. It also checks and returns whether we need a local
364364
// and/or remote anchor output.
365365
func SanityCheckAmounts(ourBalance, theirBalance btcutil.Amount,
366-
ourAssetBalance, theirAssetBalance uint64, view *DecodedView,
367-
chanType channeldb.ChannelType, whoseCommit lntypes.ChannelParty,
368-
dustLimit btcutil.Amount) (bool, bool, error) {
366+
ourAssetBalance, theirAssetBalance uint64, assetView,
367+
nonAssetView *DecodedView, chanType channeldb.ChannelType,
368+
whoseCommit lntypes.ChannelParty, dustLimit btcutil.Amount) (bool, bool,
369+
error) {
369370

370371
log.Tracef("Sanity checking amounts, whoseCommit=%v, ourBalance=%d, "+
371372
"theirBalance=%d, ourAssetBalance=%d, theirAssetBalance=%d",
372373
whoseCommit, ourBalance, theirBalance, ourAssetBalance,
373374
theirAssetBalance)
374375

375376
var (
376-
numHTLCs int64
377-
feePerKw = view.FeePerKw
377+
numHTLCs uint64
378+
feePerKw = assetView.FeePerKw
378379
)
379-
for _, entry := range view.OurUpdates {
380+
381+
// We need to count any non-dust BTC-only HTLCs too for determining
382+
// whether we need a commitment anchor output. The assetView and
383+
// nonAssetView are non-overlapping, so we can just sum the number of
384+
// non-dust HTLCs in both.
385+
for _, entry := range nonAssetView.OurUpdates {
386+
if !lnwallet.HtlcIsDust(
387+
chanType, false, whoseCommit, feePerKw,
388+
entry.Amount.ToSatoshis(), dustLimit,
389+
) {
390+
391+
numHTLCs++
392+
}
393+
}
394+
for _, entry := range nonAssetView.TheirUpdates {
395+
if !lnwallet.HtlcIsDust(
396+
chanType, true, whoseCommit, feePerKw,
397+
entry.Amount.ToSatoshis(), dustLimit,
398+
) {
399+
400+
numHTLCs++
401+
}
402+
}
403+
404+
// And finally we check the asset HTLCs. Here we also enforce that an
405+
// HTLC that's carrying an asset must be above dust.
406+
for _, entry := range assetView.OurUpdates {
380407
isDust := lnwallet.HtlcIsDust(
381408
chanType, false, whoseCommit, feePerKw,
382409
entry.Amount.ToSatoshis(), dustLimit,
@@ -391,7 +418,7 @@ func SanityCheckAmounts(ourBalance, theirBalance btcutil.Amount,
391418

392419
numHTLCs++
393420
}
394-
for _, entry := range view.TheirUpdates {
421+
for _, entry := range assetView.TheirUpdates {
395422
isDust := lnwallet.HtlcIsDust(
396423
chanType, true, whoseCommit, feePerKw,
397424
entry.Amount.ToSatoshis(), dustLimit,
@@ -488,7 +515,7 @@ func GenerateCommitmentAllocations(prevState *cmsg.Commitment,
488515
// corresponding non-dust BTC output.
489516
wantLocalAnchor, wantRemoteAnchor, err := SanityCheckAmounts(
490517
ourBalance.ToSatoshis(), theirBalance.ToSatoshis(),
491-
ourAssetBalance, theirAssetBalance, filteredView,
518+
ourAssetBalance, theirAssetBalance, filteredView, nonAssetView,
492519
chanState.ChanType, whoseCommit, dustLimit,
493520
)
494521
if err != nil {

taprpc/marshal.go

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import (
1515
"github.com/lightninglabs/taproot-assets/commitment"
1616
"github.com/lightninglabs/taproot-assets/fn"
1717
"github.com/lightninglabs/taproot-assets/rfq"
18+
"github.com/lightninglabs/taproot-assets/rfqmath"
19+
"github.com/lightninglabs/taproot-assets/rfqmsg"
1820
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
1921
"github.com/lightningnetwork/lnd/keychain"
2022
)
@@ -522,25 +524,37 @@ func MarshalAsset(ctx context.Context, a *asset.Asset,
522524
}
523525

524526
// MarshalAcceptedSellQuoteEvent marshals a peer accepted sell quote event to
525-
// its rpc representation.
527+
// its RPC representation.
526528
func MarshalAcceptedSellQuoteEvent(
527-
event *rfq.PeerAcceptedSellQuoteEvent) (*rfqrpc.PeerAcceptedSellQuote,
528-
error) {
529+
event *rfq.PeerAcceptedSellQuoteEvent) *rfqrpc.PeerAcceptedSellQuote {
530+
531+
return MarshalAcceptedSellQuote(event.SellAccept)
532+
}
533+
534+
// MarshalAcceptedSellQuote marshals a peer accepted sell quote to its RPC
535+
// representation.
536+
func MarshalAcceptedSellQuote(
537+
accept rfqmsg.SellAccept) *rfqrpc.PeerAcceptedSellQuote {
529538

530539
rpcAssetRate := &rfqrpc.FixedPoint{
531-
Coefficient: event.AssetRate.Rate.Coefficient.String(),
532-
Scale: uint32(event.AssetRate.Rate.Scale),
540+
Coefficient: accept.AssetRate.Rate.Coefficient.String(),
541+
Scale: uint32(accept.AssetRate.Rate.Scale),
533542
}
534543

535-
// TODO(ffranr): Add SellRequest payment max amount to
536-
// PeerAcceptedSellQuote.
544+
// Calculate the equivalent asset units for the given total BTC amount
545+
// based on the asset-to-BTC conversion rate.
546+
numAssetUnits := rfqmath.MilliSatoshiToUnits(
547+
accept.Request.PaymentMaxAmt, accept.AssetRate.Rate,
548+
)
549+
537550
return &rfqrpc.PeerAcceptedSellQuote{
538-
Peer: event.Peer.String(),
539-
Id: event.ID[:],
540-
Scid: uint64(event.ShortChannelId()),
551+
Peer: accept.Peer.String(),
552+
Id: accept.ID[:],
553+
Scid: uint64(accept.ShortChannelId()),
541554
BidAssetRate: rpcAssetRate,
542-
Expiry: uint64(event.AssetRate.Expiry.Unix()),
543-
}, nil
555+
Expiry: uint64(accept.AssetRate.Expiry.Unix()),
556+
AssetAmount: numAssetUnits.ScaleTo(0).ToUint64(),
557+
}
544558
}
545559

546560
// MarshalAcceptedBuyQuoteEvent marshals a peer accepted buy quote event to
@@ -636,14 +650,8 @@ func NewAddAssetSellOrderResponse(
636650

637651
switch e := event.(type) {
638652
case *rfq.PeerAcceptedSellQuoteEvent:
639-
rpcAcceptedQuote, err := MarshalAcceptedSellQuoteEvent(e)
640-
if err != nil {
641-
return nil, fmt.Errorf("unable to marshal accepted "+
642-
"sell quote event to RPC: %w", err)
643-
}
644-
645653
resp.Response = &rfqrpc.AddAssetSellOrderResponse_AcceptedQuote{
646-
AcceptedQuote: rpcAcceptedQuote,
654+
AcceptedQuote: MarshalAcceptedSellQuoteEvent(e),
647655
}
648656
return resp, nil
649657

0 commit comments

Comments
 (0)