Commit Graph

37 Commits (38ddbfb45d6cfa8b9315fbfb00576ce77f89dec0)

Author SHA1 Message Date
Oliver Gugger 38ddbfb45d
mod+loopin+loopout: update lndclient, add labels to TXs
We update to the latest lndclient that now requires a label when
publishing an on-chain transaction. Instead of just adding an empty
string, we use the proper labels added in a previous commit.
4 years ago
carla 7b56804bbe
multi: move label validation to rpc and simplify validation function
Previously labels with reserved prefixes were added to provide us
with a way to identify automatically dispatched loops. This commit moves
the validation of these labels to the rpc level so that it will only
apply to user-initiated swaps.
4 years ago
Joost Jager c8666caf20
loopin: mpp pre-swap probe 4 years ago
Andras Banki-Horvath 133f3cac5f multi: integrate the new htlc v2 scripts to loop in/out
This commit bumps the current protocol version and integrates htlc v2
with loop in/out for new swaps, while keeping htlc v1 for any pending
swaps with previous protocol versions.
4 years ago
Andras Banki-Horvath 71a7dec649
sweeper: set sequence to be able to sweep htlc v2 utxo 4 years ago
Andras Banki-Horvath cd0a5f9f06
swap: extend swap to be able to create the V2 htlc 4 years ago
carla 9678c7817d
multi: add swap label to SwapContract and store under separate key
This commits adds an optional label to our swaps, and writes it to
disk under a separate key in our swap bucket. This approach is chosen
rather than an on-the-fly addition to our existing swap contract field
so that we do not need to deal with EOF checking in the future. To allow
creation of unique internal labels, we add a reserved prefix which can
be used by the daemon to set labels that are distinct from client set
ones.
4 years ago
carla cd2b08aec6
multi: consume and log sever state updates 4 years ago
Joost Jager 1869ad670f
looprpc: expose server message to clients 4 years ago
Joost Jager 8b215edaa2
multi: create init result structs 4 years ago
Joost Jager c6c30e2988
multi: log server message 4 years ago
Joost Jager f91422d188
loopin: record htlx tx hash 4 years ago
Joost Jager a3b7fa5977
loopin: fail swap when htlc amount is incorrect
Previously the swap would get stuck in a state where it wouldn't ever
progress because the server rejected the htlc.
4 years ago
Joost Jager e33d2fb762
loopin: extract persistState 4 years ago
Joost Jager 6b8fcc547c
loopin: rename to persistAndAnnounceState 4 years ago
Joost Jager 60b907a34f
loopin: refactor htlc conf event loop 4 years ago
Joost Jager 0c9fcd790e
lndclient: move to github.com/lightninglabs/lndclient 4 years ago
Andras Banki-Horvath 0aa978bd09 loopin: modify internally published htlc to use p2wsh 4 years ago
Andras Banki-Horvath f0aff9b7bd looprpc+loopin: support for native segwit htlcs
This commit extends SwapResponse and SwapStatus with np2wsh and p2wsh
htlc output addresses to support both nested and native segwit htlcs
in loop-in.

Furthermore the commit adds support for native segwith loop-in htlcs.
When the htlc is paid internally, as of this commit we'll use NP2WSH,
otherwise users are free to select whether to pay the NP2WSH or the
P2WSH htlc.
4 years ago
Andras Banki-Horvath 87cc5571ef general: add ExternalHtlc to SwapInfo and add comments 4 years ago
Andras Banki-Horvath b2b0bad951 loopin+loopout: move htlc out of swapKit
This commit moves htlc out of swapkit in preparation of adding separate
p2wsh and np2wsh htlcs to loop-in swaps.
4 years ago
Joost Jager b69e8cb275
multi: allow loop in last hop restriction 4 years ago
Joost Jager 535e964ec9
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.
4 years ago
Joost Jager 9aaef3fd07
loopin: use discovered htlc value for timeout tx 4 years ago
Johan T. Halseth b3d1efb84c
dep+looping: update to latest lnd master
A field changed from satoshis to msat, so we must do the conversion.
4 years ago
Oliver Gugger b574e344ea
multi: add persistent logger 4 years ago
Oliver Gugger 69f2af9fdc
loop+cmd: extract types into swap module 5 years ago
Oliver Gugger 36838cf7f4
multi: fix most obvious linter errors 5 years ago
Johan T. Halseth 0023d1a0da
looprpc: update to new server protos
We update to new set of server protos where new Terms calls are added.
Here static information will be returned from the server.

We no longer have a feebase+feerate, but get a final fee directly
returned by the server.
5 years ago
Joost Jager ecd36b921c
multi: base sweep fee estimate on actually used address type 5 years ago
Joost Jager 6efa62347b
multi: store swap cost in database 5 years ago
Joost Jager 1b306ad425
loopdb: replace swap state enum by state data object
This commits lays down the foundation in the database for adding more
persistent state data to swaps.
5 years ago
Joost Jager 30c7d71c57
use np2wsh for loop in htlc 5 years ago
Joost Jager e765baa1f9
loopd: check loop in timeout already before a new block comes in 5 years ago
Joost Jager b5d2fb3894
loopd: add loop in state InvoiceSettled 5 years ago
Joost Jager 2e48ead6d6
loopd: loop in from external address
Allow user to specify that htlc will be published by an external source.
In that case no internal htlc tx will be published.

To facilitate sending to the htlc address, the swap initiation response
is extended with that address.
5 years ago
Joost Jager 3e960b8b54
multi: loop in swap 5 years ago