@@ -346,10 +346,7 @@ func (n *Negotiator) HandleIncomingBuyRequest(
346346 }
347347
348348 // Construct and send a buy accept message.
349- expiry := uint64 (assetRate .Expiry .Unix ())
350- msg := rfqmsg .NewBuyAcceptFromRequest (
351- request , assetRate .Rate , expiry ,
352- )
349+ msg := rfqmsg .NewBuyAcceptFromRequest (request , * assetRate )
353350 sendOutgoingMsg (msg )
354351 }()
355352
@@ -549,10 +546,12 @@ func (n *Negotiator) HandleIncomingBuyAccept(msg rfqmsg.BuyAccept,
549546 // TODO(ffranr): Sanity check the buy accept quote expiry
550547 // timestamp given the expiry timestamp provided by the price
551548 // oracle.
552- if ! expiryWithinBounds (msg .Expiry , minAssetRatesExpiryLifetime ) {
549+ expiry := uint64 (msg .AssetRate .Expiry .Unix ())
550+ if ! expiryWithinBounds (expiry , minAssetRatesExpiryLifetime ) {
553551 // The expiry time is not within the acceptable bounds.
554552 log .Debugf ("Buy accept quote expiry time is not within " +
555- "acceptable bounds (expiry=%d)" , msg .Expiry )
553+ "acceptable bounds (asset_rate=%s)" ,
554+ msg .AssetRate .String ())
556555
557556 // Construct an invalid quote response event so that we can
558557 // inform the peer that the quote response has not validated
@@ -633,17 +632,17 @@ func (n *Negotiator) HandleIncomingBuyAccept(msg rfqmsg.BuyAccept,
633632 tolerance := rfqmath .NewBigIntFromUint64 (
634633 n .cfg .AcceptPriceDeviationPpm ,
635634 )
636- acceptablePrice := msg .AssetRate .WithinTolerance (
635+ acceptablePrice := msg .AssetRate .Rate . WithinTolerance (
637636 assetRate .Rate , tolerance ,
638637 )
639638 if ! acceptablePrice {
640639 // The price is not within the acceptable tolerance.
641640 // We will return without calling the quote accept
642641 // callback.
643642 log .Debugf ("Buy accept price is not within " +
644- "acceptable bounds (ask_asset_rate=%v , " +
645- "oracle_asset_rate=%v )" , msg .AssetRate ,
646- assetRate )
643+ "acceptable bounds (peer_asset_rate=%s , " +
644+ "oracle_asset_rate=%s )" , msg .AssetRate . String () ,
645+ assetRate . String () )
647646
648647 // Construct an invalid quote response event so that we
649648 // can inform the peer that the quote response has not
0 commit comments