2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-13 13:10:30 +00:00
Commit Graph

59 Commits

Author SHA1 Message Date
sputn1ck
efb6f75d60
swap: add lasthop, outgoingchanids to swapinfo 2022-05-31 16:26:51 +02:00
Carsten Otto
b0044e0994 loopout: remove double space in log message 2022-05-06 17:34:19 +02:00
Harsha Goli
7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2022-03-25 11:00:16 +01:00
Andras Banki-Horvath
32d55dc814
loopout: do not report prepays and fix plugin type if acquire fails 2022-02-18 08:42:42 +01:00
Andras Banki-Horvath
ffd52aba2f
loopout: add low/high routing plugin 2022-02-14 10:14:47 +01:00
Andras Banki-Horvath
1d1354d2cb
config: make total payment timeout and retries configurable 2022-02-14 10:14:47 +01:00
Andras Banki-Horvath
1943edfd78
loopout: use optional routing plugin for the main swap invoice 2022-02-14 10:14:46 +01:00
carla
d1c26a20da
multi: surface server swap initiation grpc error codes
Formatting our error was stifling any grpc error returned by the
server. Instead, we bubble up our grpc error, setting an unknown
code if the server did not specifically return an error code.
2021-07-19 10:28:34 +02:00
carla
f166ce899d
loopout: cancel swap with server when off-chain fails 2021-05-24 08:46:03 +02:00
carla
16111352a8
multi: add cancel swap function to execute config 2021-05-24 08:40:14 +02:00
carla
4040bb356d
loopout: refactor payInvoice to return more payment information
We're going to want more information about our failures going
forward, so we refactor payInvoice to return a full payment
status. The primary change in this commit is that we surface
both types of payment failures (result.err when we fail immediately,
and lnrpc.Failure when our payment is failed back) and return them
in the failure() method, rather than combining this information
at a lower level.
2021-05-24 08:40:13 +02:00
carla
9db8bd5f2a
loopout: do not reveal preimage if time to safe reveal has passed 2021-05-12 14:09:28 +02:00
Oliver Gugger
2a732a4385
loop: add initiator string to user agent 2020-11-06 10:43:03 +01:00
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.
2020-10-15 10:40:12 +02:00
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.
2020-10-12 13:34:52 +02:00
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.
2020-09-09 19:54:01 +02:00
András Bánki-Horváth
02a16d097e
Merge pull request #255 from bhandras/htlc_v2
preliminary work for integrating the v2 HTLC script
2020-08-27 16:50:05 +02:00
Andras Banki-Horvath
71a7dec649
sweeper: set sequence to be able to sweep htlc v2 utxo 2020-08-27 16:21:51 +02:00
Alex Bosworth
a47eacff62
loopout: Increase payment timeout
Allow for more time to search for low-routing fee pathways to the Loop service
2020-08-25 11:46:03 -07:00
Alex Bosworth
a29cb86b4a
Update loopout.go 2020-08-24 13:40:28 -07:00
Alex Bosworth
a9cbb34be0
loopout: Increase default sweep confirmation target
Now that the server supports a longer CLTV maximum, the default sweep target may be increased to allow for lower on-chain costs
2020-08-20 11:56:28 -07:00
carla
852f459391
multi: add htlc confirmations parameter to client loop out request 2020-08-04 20:29:09 +02:00
carla
1877b7f08b
multi: store loop out htlc confirmations on disk
To allow users to specify differing confirmation targets, we store the
swap conf target per-swap. This makes us restart safe, so we do not
forget confirmation values for swaps that are in flight when we restart.
2020-08-04 20:28:06 +02:00
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.
2020-08-03 10:55:58 +02:00
Joost Jager
43323ffbe2
loopout: extend htlc expiry based on conf target 2020-07-16 21:30:16 +02:00
carla
cd2b08aec6
multi: consume and log sever state updates 2020-07-16 21:02:06 +02:00
Joost Jager
1869ad670f
looprpc: expose server message to clients 2020-06-30 16:59:10 +02:00
Joost Jager
8b215edaa2
multi: create init result structs 2020-06-30 16:59:08 +02:00
Joost Jager
c6c30e2988
multi: log server message 2020-06-30 16:59:04 +02:00
Joost Jager
e22524a262
loopout: register for confirmation using htlc tx hash 2020-06-24 15:28:12 +02:00
Joost Jager
0c9fcd790e
lndclient: move to github.com/lightninglabs/lndclient 2020-06-18 14:27:52 +02:00
carla
65c847674d
multi: add preimage push to loop out after sweep attempt
Once we have revealed our preimage to the world with a sweep attempt,
we can safely push our preimage to the server to speed up on chain
claim.

Rather than rely on the server, we use the state of our invoice in lnd
to determine whether we should continue trying to push the preimage to
the server.
2020-06-08 12:54:08 +02:00
Joost Jager
8c544bf2ba
loopdb: store outgoing channel set
Upgrade the database schema to allow for multiple outgoing channels.
This is implemented as an on-the-fly migration leaving the old key in
place.
2020-05-21 11:22:04 +02:00
Joost Jager
c62acd5b85
lndclient: add outgoing channel set restriction
Expose the channel set restriction that was introduced in LND 0.10.1 on
the proxy object.
2020-05-21 11:21:58 +02:00
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.
2020-05-05 15:49:05 +02:00
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.
2020-05-04 23:18:14 +02:00
Joost Jager
12ae3d6a40
loopd: make maximum number of payment parts configurable 2020-04-27 16:32:12 +02:00
Joost Jager
65375723b4
lndclient: upgrade to lnd v0.10.0-beta-rc5 2020-04-27 16:30:42 +02:00
Joost Jager
4a714e0c96
Merge pull request #178 from joostjager/loopout-routerrpc
loopout: allow multi-loop
2020-04-20 10:13:58 +02:00
carla
1f5aeff45f
multi: unify default sweep/htlc conf targets
Create a HtlcConfTarget which is used as a default for quote
and loop in. Update loop out quote to use the existing var
rather than just 6 inline.
2020-04-17 09:40:18 +02:00
Joost Jager
6acd76e237
loopout: allow multi-loop 2020-04-16 16:45:01 +02:00
Joost Jager
710ae77750
loopout: log in-flight htlc status 2020-04-16 16:40:37 +02:00
Joost Jager
4039ba9b69
loopout: use routerrpc to send payments 2020-04-16 16:40:35 +02:00
Johan T. Halseth
c70d0deecb
swap_server_client: let the SwapPublicationDeadline be set during LoopOuts 2019-11-21 18:47:01 +01:00
Oliver Gugger
b574e344ea
multi: add persistent logger 2019-10-28 17:09:23 +01:00
Oliver Gugger
69f2af9fdc
loop+cmd: extract types into swap module 2019-10-09 16:14:06 +02:00
Wilmer Paulino
e0d23cb180
loopout: compare delta from htlc expiry correctly
This addresses an issue where using a sweep confirmation target greater
than the default would result in most cases not revealing the preimage
due to the default confirmation target yielding a higher fee than the
max miner fee backed by the confirmation target provided.
2019-10-02 11:07:07 -04:00
Alex Bosworth
6608337bb4
Merge pull request #71 from joostjager/address-estimate
multi: base sweep fee estimate on actually used address type
2019-07-31 09:30:18 -07:00
Bjorn Olav Jalborg
8d7a272fdd loop+loopout: validate hash of swap invoice
This commit fixes a possible exploit by the loop server, where
- in a loop out - the server could claim money off-chain, without
publishing an on-chain swap htlc.

The server could do this by responding with a regular invoice, whose hash
is different than the hash in the NewLoopOutSwap request. To prevent
the exploit, we validate that the hash of the swap invoice is equal to the
hash the client generated.
2019-07-31 11:01:42 +02:00
Joost Jager
ecd36b921c
multi: base sweep fee estimate on actually used address type 2019-07-30 13:59:34 +02:00