From 48f6f0fc5cd85e1e96d30ce8c5ef8680c31a514c Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 7 Jan 2020 13:28:22 +0100 Subject: [PATCH 1/6] looprpc: add updated server proto --- looprpc/server.pb.go | 101 +++++++++++++++++++++++-------------------- looprpc/server.proto | 3 ++ 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/looprpc/server.pb.go b/looprpc/server.pb.go index 9d1260e..9b1afbf 100644 --- a/looprpc/server.pb.go +++ b/looprpc/server.pb.go @@ -152,10 +152,12 @@ func (m *ServerLoopOutResponse) GetExpiry() int32 { type ServerLoopOutQuoteRequest struct { /// The swap amount. If zero, a quote for a maximum amt swap will be given. - Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` + /// The unix time in seconds we want the on-chain swap to be published by. + SwapPublicationDeadline int64 `protobuf:"varint,2,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ServerLoopOutQuoteRequest) Reset() { *m = ServerLoopOutQuoteRequest{} } @@ -190,6 +192,13 @@ func (m *ServerLoopOutQuoteRequest) GetAmt() uint64 { return 0 } +func (m *ServerLoopOutQuoteRequest) GetSwapPublicationDeadline() int64 { + if m != nil { + return m.SwapPublicationDeadline + } + return 0 +} + type ServerLoopOutQuote struct { SwapPaymentDest string `protobuf:"bytes,1,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"` /// The total estimated swap fee given the quote amt. @@ -680,50 +689,50 @@ func init() { func init() { proto.RegisterFile("server.proto", fileDescriptor_ad098daeda4239f7) } var fileDescriptor_ad098daeda4239f7 = []byte{ - // 674 bytes of a gzipped FileDescriptorProto + // 677 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x4e, 0xdb, 0x4c, - 0x10, 0x95, 0xed, 0x10, 0xbe, 0x0c, 0x09, 0x7c, 0x6c, 0xff, 0x4c, 0x20, 0x15, 0x58, 0x2a, 0x42, - 0xa8, 0x05, 0xa9, 0xbd, 0xeb, 0x1d, 0x15, 0x42, 0x45, 0x45, 0xa5, 0x18, 0xee, 0xad, 0x25, 0x99, + 0x10, 0x95, 0x9d, 0x10, 0xbe, 0x0c, 0x09, 0x7c, 0x6c, 0xff, 0x4c, 0x20, 0x15, 0x58, 0x2a, 0x42, + 0xa8, 0x02, 0xa9, 0xbd, 0xeb, 0x1d, 0x15, 0x42, 0x45, 0x45, 0xa5, 0x18, 0xee, 0xad, 0x25, 0x99, 0x82, 0xd5, 0x78, 0x77, 0x6b, 0x6f, 0x02, 0x79, 0x81, 0x3e, 0x43, 0x7b, 0xdf, 0x57, 0xea, 0x83, - 0xf4, 0x0d, 0xaa, 0xfd, 0x31, 0xb1, 0x9d, 0x84, 0x14, 0xa9, 0x77, 0xec, 0x99, 0xc3, 0xec, 0x99, - 0x33, 0x67, 0x1d, 0x68, 0x66, 0x98, 0x0e, 0x31, 0xdd, 0x13, 0x29, 0x97, 0x9c, 0x2c, 0xf6, 0x39, - 0x17, 0xa9, 0xe8, 0xb6, 0x37, 0xae, 0x38, 0xbf, 0xea, 0xe3, 0x3e, 0x15, 0xf1, 0x3e, 0x65, 0x8c, - 0x4b, 0x2a, 0x63, 0xce, 0x32, 0x43, 0x0b, 0x7e, 0x3a, 0xf0, 0xf8, 0x5c, 0xff, 0xdf, 0x09, 0xe7, - 0xe2, 0x74, 0x20, 0x43, 0xfc, 0x3a, 0xc0, 0x4c, 0x92, 0x2d, 0x68, 0xa6, 0xd8, 0xc5, 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, 0x9d, 0xf7, 0x58, 0xaf, 0x83, 0x6c, 0xcc, 0x24, 0x67, 0xad, 0xba, + 0x15, 0x55, 0x3b, 0xec, 0x45, 0xa6, 0xcd, 0x48, 0x9d, 0xad, 0xad, 0x30, 0xaa, 0x3f, 0x8f, 0x62, + 0xba, 0x5e, 0x36, 0xf4, 0x2f, 0xf5, 0xdb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x49, 0xdb, + 0x27, 0xe0, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/looprpc/server.proto b/looprpc/server.proto index 6125167..6ab28f6 100644 --- a/looprpc/server.proto +++ b/looprpc/server.proto @@ -42,6 +42,9 @@ message ServerLoopOutResponse { message ServerLoopOutQuoteRequest { /// The swap amount. If zero, a quote for a maximum amt swap will be given. uint64 amt = 1; + + /// The unix time in seconds we want the on-chain swap to be published by. + int64 swap_publication_deadline = 2; } message ServerLoopOutQuote { From b102802ce581201a73f9717956df31566f7cb4a5 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 7 Jan 2020 13:43:39 +0100 Subject: [PATCH 2/6] looprpc: add SwapPublicationDeadline to QuoteRequest --- looprpc/client.pb.go | 189 +++++++++++++++++++----------------- looprpc/client.proto | 9 ++ looprpc/client.swagger.json | 16 +++ 3 files changed, 127 insertions(+), 87 deletions(-) diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index 94610e4..6898c86 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -667,10 +667,17 @@ type QuoteRequest struct { //* //If external_htlc is true, we expect the htlc to be published by an external //actor. - ExternalHtlc bool `protobuf:"varint,3,opt,name=external_htlc,json=externalHtlc,proto3" json:"external_htlc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ExternalHtlc bool `protobuf:"varint,3,opt,name=external_htlc,json=externalHtlc,proto3" json:"external_htlc,omitempty"` + //* + //The latest time (in unix seconds) we allow the server to wait before + //publishing the HTLC on chain. Setting this to a larger value will give the + //server the opportunity to batch multiple swaps together, and wait for + //low-fee periods before publishing the HTLC, potentially resulting in a + //lower total swap fee. + SwapPublicationDeadline uint64 `protobuf:"varint,4,opt,name=swap_publication_deadline,json=swapPublicationDeadline,proto3" json:"swap_publication_deadline,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *QuoteRequest) Reset() { *m = QuoteRequest{} } @@ -719,6 +726,13 @@ func (m *QuoteRequest) GetExternalHtlc() bool { return false } +func (m *QuoteRequest) GetSwapPublicationDeadline() uint64 { + if m != nil { + return m.SwapPublicationDeadline + } + return 0 +} + type QuoteResponse struct { //* //The fee that the swap server is charging for the swap. @@ -1007,89 +1021,90 @@ func init() { func init() { proto.RegisterFile("client.proto", fileDescriptor_014de31d7ac8c57c) } var fileDescriptor_014de31d7ac8c57c = []byte{ - // 1310 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x72, 0x1a, 0x47, - 0x10, 0x36, 0x3f, 0x12, 0xd0, 0x2c, 0xcb, 0x6a, 0x64, 0x4b, 0x48, 0x89, 0xcb, 0x78, 0x13, 0x3b, - 0x44, 0x07, 0x13, 0xdb, 0xa7, 0xb8, 0x72, 0x21, 0x08, 0x5b, 0xa8, 0x24, 0x41, 0x16, 0xe4, 0x2a, - 0xe7, 0xb2, 0x19, 0xc3, 0x48, 0xda, 0x0a, 0x3b, 0xbb, 0xde, 0x19, 0x6c, 0xa9, 0x52, 0xbe, 0xe4, - 0x15, 0x72, 0xcb, 0x5b, 0xa4, 0x2a, 0xb7, 0x9c, 0xf2, 0x0c, 0xb9, 0xe7, 0x94, 0x07, 0x49, 0x4d, - 0xcf, 0xb0, 0x5a, 0x84, 0x7d,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, 0xc8, 0xf5, 0xc9, 0xd9, 0xc9, 0xb6, - 0xbb, 0x75, 0x13, 0x36, 0x11, 0xed, 0x62, 0x44, 0xb7, 0x09, 0xc9, 0xe6, 0xd8, 0x96, 0x28, 0xe5, - 0xa7, 0xd2, 0x38, 0x2c, 0x32, 0xd2, 0xd9, 0x29, 0x95, 0x91, 0x5e, 0x9a, 0x29, 0x6e, 0x13, 0xa5, - 0x77, 0x49, 0x63, 0x49, 0xfa, 0x8d, 0xe2, 0xb4, 0x7f, 0xa1, 0xa1, 0x7c, 0x4f, 0x7e, 0x04, 0xfb, - 0x05, 0x93, 0xba, 0x72, 0x9f, 0x14, 0xfd, 0x0e, 0x1e, 0xb1, 0x49, 0x36, 0x32, 0xf5, 0x34, 0xc1, - 0xff, 0x94, 0xd1, 0xfe, 0xa4, 0xf0, 0xef, 0xa1, 0xf6, 0x0e, 0xd9, 0xce, 0x6a, 0x67, 0xa3, 0x7f, - 0x05, 0x35, 0x75, 0xc2, 0x62, 0x88, 0x88, 0x8c, 0x19, 0x96, 0x26, 0xd5, 0xee, 0xf6, 0x0a, 0xbe, - 0x6c, 0x30, 0x52, 0xc7, 0x23, 0x04, 0x95, 0x6d, 0x3d, 0x9d, 0x5e, 0xaf, 0xe3, 0x1f, 0xd5, 0xa7, - 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xbc, 0xc2, 0x52, 0x9d, 0xdf, 0x0a, 0x00, 0x00, + // 1322 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x72, 0x1a, 0xc7, + 0x16, 0xf6, 0xc0, 0x20, 0xe0, 0x30, 0x0c, 0xa3, 0x96, 0x2d, 0x21, 0xee, 0x75, 0x19, 0xcf, 0xbd, + 0x76, 0x88, 0x16, 0x26, 0xb6, 0x57, 0x71, 0x65, 0x43, 0x10, 0xb6, 0x50, 0x49, 0x82, 0x0c, 0xc8, + 0x55, 0xce, 0x66, 0xd2, 0x86, 0x96, 0x34, 0x15, 0xa6, 0x67, 0x3c, 0xdd, 0xd8, 0x52, 0xa5, 0xbc, + 0xc9, 0x2b, 0x64, 0x97, 0x65, 0xde, 0x20, 0x55, 0xd9, 0x65, 0x95, 0x67, 0xc8, 0x3e, 0xab, 0x3c, + 0x48, 0xaa, 0x7f, 0x66, 0x34, 0x88, 0xd8, 0x0b, 0xef, 0xe0, 0xeb, 0xaf, 0xbf, 0x3e, 0xe7, 0xf4, + 0x77, 0x4e, 0x0f, 0x58, 0xb3, 0x45, 0x40, 0x28, 0x7f, 0x14, 0x27, 0x11, 0x8f, 0x50, 0x79, 0x11, + 0x45, 0x71, 0x12, 0xcf, 0x5a, 0xff, 0x3d, 0x8f, 0xa2, 0xf3, 0x05, 0xe9, 0xe2, 0x38, 0xe8, 0x62, + 0x4a, 0x23, 0x8e, 0x79, 0x10, 0x51, 0xa6, 0x68, 0xee, 0xcf, 0x45, 0xb0, 0x8f, 0xa2, 0x28, 0x1e, + 0x2d, 0xb9, 0x47, 0xde, 0x2c, 0x09, 0xe3, 0xc8, 0x81, 0x22, 0x0e, 0x79, 0xd3, 0x68, 0x1b, 0x9d, + 0xa2, 0x27, 0x7e, 0x22, 0x04, 0xe6, 0x9c, 0x30, 0xde, 0x2c, 0xb4, 0x8d, 0x4e, 0xd5, 0x93, 0xbf, + 0x51, 0x17, 0x6e, 0x87, 0xf8, 0xd2, 0x67, 0xef, 0x70, 0xec, 0x27, 0xd1, 0x92, 0x07, 0xf4, 0xdc, + 0x3f, 0x23, 0xa4, 0x59, 0x94, 0xdb, 0x36, 0x43, 0x7c, 0x39, 0x79, 0x87, 0x63, 0x4f, 0xad, 0x3c, + 0x27, 0x04, 0x3d, 0x85, 0x6d, 0xb1, 0x21, 0x4e, 0x48, 0x8c, 0xaf, 0x56, 0xb6, 0x98, 0x72, 0xcb, + 0x56, 0x88, 0x2f, 0xc7, 0x72, 0x31, 0xb7, 0xa9, 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1, 0xed, 0x15, 0xc9, 0xec, 0xc1, + 0xfb, 0x90, 0xe2, 0xb6, 0x54, 0x74, 0xdc, 0x5a, 0xa6, 0x18, 0x50, 0x21, 0xf8, 0x25, 0x94, 0xf5, + 0xbb, 0x91, 0x0b, 0x72, 0xf5, 0x25, 0x69, 0x6d, 0xad, 0x8d, 0xf8, 0x25, 0xfb, 0xc2, 0x40, 0xaf, + 0xc0, 0xd2, 0xd9, 0xc8, 0xb1, 0x87, 0xae, 0x4f, 0xce, 0x8f, 0xc5, 0xd6, 0xf6, 0x4d, 0x58, 0x47, + 0xd4, 0x92, 0x11, 0xdd, 0x46, 0x28, 0x9f, 0x63, 0x97, 0x4b, 0x29, 0x3f, 0x93, 0x96, 0xc3, 0x22, + 0x27, 0x9d, 0x9f, 0x70, 0x39, 0xe9, 0x95, 0x99, 0xe2, 0xb6, 0xa5, 0x74, 0x0b, 0x35, 0x57, 0xa4, + 0xdf, 0x08, 0x4e, 0xf7, 0x07, 0x1c, 0xf2, 0xf7, 0xe8, 0x5b, 0xb0, 0x5f, 0x10, 0xae, 0x2a, 0xf7, + 0x49, 0xd1, 0xef, 0xca, 0x23, 0xb6, 0xd0, 0x66, 0xae, 0x9e, 0x3a, 0xf8, 0xef, 0x72, 0xda, 0x9f, + 0x14, 0xfe, 0x3d, 0xa9, 0xbd, 0x8b, 0x76, 0xf2, 0xda, 0xf9, 0xe8, 0x5f, 0x41, 0x5d, 0x9c, 0x90, + 0x0e, 0x11, 0x96, 0x33, 0xc3, 0xca, 0xa4, 0x6a, 0xed, 0xac, 0xe1, 0xab, 0x06, 0x43, 0x0d, 0x79, + 0x04, 0xc3, 0xbc, 0xab, 0xa6, 0xd3, 0xeb, 0x0d, 0xf9, 0x95, 0xfb, 0xf4, 0x9f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x55, 0xbe, 0xbc, 0x0e, 0x1c, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/looprpc/client.proto b/looprpc/client.proto index 7e996d9..e9b7a68 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -356,6 +356,15 @@ message QuoteRequest { actor. */ bool external_htlc = 3; + + /** + The latest time (in unix seconds) we allow the server to wait before + publishing the HTLC on chain. Setting this to a larger value will give the + server the opportunity to batch multiple swaps together, and wait for + low-fee periods before publishing the HTLC, potentially resulting in a + lower total swap fee. + */ + uint64 swap_publication_deadline = 4; } message QuoteResponse { diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index e991dfa..0acdb39 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -78,6 +78,14 @@ "required": false, "type": "boolean", "format": "boolean" + }, + { + "name": "swap_publication_deadline", + "description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee.", + "in": "query", + "required": false, + "type": "string", + "format": "uint64" } ], "tags": [ @@ -165,6 +173,14 @@ "required": false, "type": "boolean", "format": "boolean" + }, + { + "name": "swap_publication_deadline", + "description": "*\nThe latest time (in unix seconds) we allow the server to wait before\npublishing the HTLC on chain. Setting this to a larger value will give the\nserver the opportunity to batch multiple swaps together, and wait for\nlow-fee periods before publishing the HTLC, potentially resulting in a\nlower total swap fee.", + "in": "query", + "required": false, + "type": "string", + "format": "uint64" } ], "tags": [ From dcc5a8ce8813fc5f32388e6005992da3aef2d565 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 7 Jan 2020 13:46:40 +0100 Subject: [PATCH 3/6] cmd/loop: add fast option to quote cmd --- cmd/loop/quote.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/cmd/loop/quote.go b/cmd/loop/quote.go index ec4ddd0..ad4e409 100644 --- a/cmd/loop/quote.go +++ b/cmd/loop/quote.go @@ -2,6 +2,7 @@ package main import ( "context" + "time" "github.com/lightninglabs/loop/looprpc" "github.com/urfave/cli" @@ -20,6 +21,16 @@ var quoteCommand = cli.Command{ "should be swept within in a Loop Out", Value: 6, }, + cli.BoolFlag{ + Name: "fast", + Usage: "Indicate you want to swap immediately, " + + "paying potentially a higher fee. If not " + + "set the swap server might choose to wait up " + + "to 30 minutes before publishing the swap " + + "HTLC on-chain, to save on chain fees. Not " + + "setting this flag might result in a lower " + + "swap fee.", + }, }, Action: quote, } @@ -43,10 +54,17 @@ func quote(ctx *cli.Context) error { } defer cleanup() + fast := ctx.Bool("fast") + swapDeadline := time.Now() + if !fast { + swapDeadline = time.Now().Add(defaultSwapWaitTime) + } + ctxb := context.Background() resp, err := client.LoopOutQuote(ctxb, &looprpc.QuoteRequest{ - Amt: int64(amt), - ConfTarget: int32(ctx.Uint64("conf_target")), + Amt: int64(amt), + ConfTarget: int32(ctx.Uint64("conf_target")), + SwapPublicationDeadline: uint64(swapDeadline.Unix()), }) if err != nil { return err From 18608a6aa38c03b6d650b6cc41eea86cff4cd03e Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 7 Jan 2020 13:47:07 +0100 Subject: [PATCH 4/6] cmd/loop: account for fast swap in loopout cmd quote --- cmd/loop/loopout.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/loop/loopout.go b/cmd/loop/loopout.go index 64d80c3..bb05970 100644 --- a/cmd/loop/loopout.go +++ b/cmd/loop/loopout.go @@ -93,10 +93,19 @@ func loopOut(ctx *cli.Context) error { } defer cleanup() + // Set our maximum swap wait time. If a fast swap is requested we set + // it to now, otherwise to 30 minutes in the future. + fast := ctx.Bool("fast") + swapDeadline := time.Now() + if !fast { + swapDeadline = time.Now().Add(defaultSwapWaitTime) + } + sweepConfTarget := int32(ctx.Uint64("conf_target")) quoteReq := &looprpc.QuoteRequest{ - Amt: int64(amt), - ConfTarget: sweepConfTarget, + Amt: int64(amt), + ConfTarget: sweepConfTarget, + SwapPublicationDeadline: uint64(swapDeadline.Unix()), } quote, err := client.LoopOutQuote(context.Background(), quoteReq) if err != nil { @@ -104,7 +113,6 @@ func loopOut(ctx *cli.Context) error { } // Show a warning if a slow swap was requested. - fast := ctx.Bool("fast") warning := "" if fast { warning = "Fast swap requested." @@ -125,13 +133,6 @@ func loopOut(ctx *cli.Context) error { unchargeChannel = ctx.Uint64("channel") } - // Set our maximum swap wait time. If a fast swap is requested we set - // it to now, otherwise to 30 minutes in the future. - swapDeadline := time.Now() - if !fast { - swapDeadline = time.Now().Add(defaultSwapWaitTime) - } - resp, err := client.LoopOut(context.Background(), &looprpc.LoopOutRequest{ Amt: int64(amt), Dest: destAddr, From b2d1d99521e21fa15efd9c3c73ccb8d74979cfeb Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 7 Jan 2020 13:52:42 +0100 Subject: [PATCH 5/6] loopd call swapserver with SwapPublicationDeadline set --- interface.go | 4 ++++ loopd/swapclient_server.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/interface.go b/interface.go index 94d709b..e445b66 100644 --- a/interface.go +++ b/interface.go @@ -99,6 +99,10 @@ type LoopOutQuoteRequest struct { // client sweep tx. SweepConfTarget int32 + // SwapPublicationDeadline can be set by the client to allow the server + // delaying publication of the swap HTLC to save on chain fees. + SwapPublicationDeadline time.Time + // TODO: Add argument to specify confirmation target for server // publishing htlc. This may influence the swap fee quote, because the // server needs to pay more for faster confirmations. diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index 232061f..4f704ab 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -266,6 +266,9 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context, quote, err := s.impl.LoopOutQuote(ctx, &loop.LoopOutQuoteRequest{ Amount: btcutil.Amount(req.Amt), SweepConfTarget: confTarget, + SwapPublicationDeadline: time.Unix( + int64(req.SwapPublicationDeadline), 0, + ), }) if err != nil { return nil, err From d5c9a66c6053814a016b9df91bdf5589229d49d1 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 7 Jan 2020 13:53:18 +0100 Subject: [PATCH 6/6] swap_server_client: call server with SwapPublicationDeadline set --- client.go | 4 +++- server_mock_test.go | 4 ++-- swap_server_client.go | 9 ++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client.go b/client.go index 177c58d..4f32173 100644 --- a/client.go +++ b/client.go @@ -369,7 +369,9 @@ func (s *Client) LoopOutQuote(ctx context.Context, return nil, ErrSwapAmountTooHigh } - quote, err := s.Server.GetLoopOutQuote(ctx, request.Amount) + quote, err := s.Server.GetLoopOutQuote( + ctx, request.Amount, request.SwapPublicationDeadline, + ) if err != nil { return nil, err } diff --git a/server_mock_test.go b/server_mock_test.go index 5629904..b8cbdd7 100644 --- a/server_mock_test.go +++ b/server_mock_test.go @@ -94,8 +94,8 @@ func (s *serverMock) GetLoopOutTerms(ctx context.Context) ( }, nil } -func (s *serverMock) GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) ( - *LoopOutQuote, error) { +func (s *serverMock) GetLoopOutQuote(ctx context.Context, amt btcutil.Amount, + _ time.Time) (*LoopOutQuote, error) { dest := [33]byte{1, 2, 3} diff --git a/swap_server_client.go b/swap_server_client.go index fc071cc..b8e67f6 100644 --- a/swap_server_client.go +++ b/swap_server_client.go @@ -22,7 +22,8 @@ type swapServerClient interface { GetLoopOutTerms(ctx context.Context) ( *LoopOutTerms, error) - GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) ( + GetLoopOutQuote(ctx context.Context, amt btcutil.Amount, + swapPublicationDeadline time.Time) ( *LoopOutQuote, error) GetLoopInTerms(ctx context.Context) ( @@ -93,13 +94,15 @@ func (s *grpcSwapServerClient) GetLoopOutTerms(ctx context.Context) ( } func (s *grpcSwapServerClient) GetLoopOutQuote(ctx context.Context, - amt btcutil.Amount) (*LoopOutQuote, error) { + amt btcutil.Amount, swapPublicationDeadline time.Time) ( + *LoopOutQuote, error) { rpcCtx, rpcCancel := context.WithTimeout(ctx, globalCallTimeout) defer rpcCancel() quoteResp, err := s.server.LoopOutQuote(rpcCtx, &looprpc.ServerLoopOutQuoteRequest{ - Amt: uint64(amt), + Amt: uint64(amt), + SwapPublicationDeadline: swapPublicationDeadline.Unix(), }, ) if err != nil {