loopdb: migrate loop in channel to last hop

A database field was already in place to allow channel selection for
loop in. Unfortunately this field, which contains a short channel id,
isn't easily usable for controlling the loop server payment. Because of
non-strict forwarding, it is only possible to constrain a route to a
specific last hop pubkey.

This commit converts the existing field into a pubkey field.
This commit is contained in:
Joost Jager 2020-02-11 13:25:03 +01:00
parent 1ebba410ea
commit 535e964ec9
No known key found for this signature in database
GPG key ID: A61B9D4C393C59C7
12 changed files with 252 additions and 514 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/routing/route"
)
// OutRequest contains the required parameters for a loop out swap.
@ -173,9 +174,9 @@ type LoopInRequest struct {
// client htlc tx.
HtlcConfTarget int32
// LoopInChannel optionally specifies the short channel id of the
// channel to loop in.
LoopInChannel *uint64
// LastHop optionally specifies the last hop to use for the loop in
// payment.
LastHop *route.Vertex
// ExternalHtlc specifies whether the htlc is published by an external
// source.