Commit Graph

19 Commits

Author SHA1 Message Date
Johan T. Halseth
92af2342da
lnwallet+nursery+input: set sequence=1 for direct HTLC spends 2020-03-09 12:59:33 +01:00
Joost Jager
919ab60540
utxonursery: remove unused commit sweep code
Now that the commit sweep resolver is no longer relying on the nursery,
all code associated with commit sweeping can be removed.
2019-11-14 13:38:03 +01:00
Joost Jager
50abb41e94
cnct: store full htlc struct inside resolver
This change prepares for accessing the onion blob from a resolver.
2019-11-12 15:01:36 +01:00
Joost Jager
a83be177c6
cnct: move supplement method into resolvers 2019-11-12 14:55:03 +01:00
Joost Jager
32249cb72e
cnct: add new methods for resolvers 2019-11-11 14:35:30 +01:00
Joost Jager
1e5eec990e
cnct: add new from reader resolver initializers 2019-11-11 14:35:28 +01:00
Joost Jager
ff63a680a1
cnct: instantiate quit channels inside resolvers
Removes a bug-prone construction that existed previously where the quit
channel was replaced just-in-time.
2019-11-07 13:10:35 +01:00
Joost Jager
75ecbfd321
cnct: unexport ResolverKit quit field 2019-11-07 13:10:33 +01:00
Joost Jager
ecd3c59f7a
cnct: do not log resolver shutting down as error 2019-09-11 15:54:41 +02:00
Joost Jager
064e8492de
cnct+htlcswitch+invoices: move invoice parameter check out of link
This commit is the final step in making the link unaware of invoices. It
now purely offers the htlc to the invoice registry and follows
instructions from the invoice registry about how and when to respond to
the htlc.

The change also fixes a bug where upon restart, hodl htlcs were
subjected to the invoice minimum cltv delta requirement again. If the
block height has increased in the mean while, the htlc would be canceled
back.

Furthermore the invoice registry interaction is aligned between link and
contract resolvers.
2019-05-15 14:42:12 +02:00
Joost Jager
32f2b047e8
htlcswitch: hodl invoice
This commit modifies the invoice registry to handle invoices for which
the preimage is not known yet (hodl invoices). In that case, the
resolution channel passed in from links and resolvers is stored until we
either learn the preimage or want to cancel the htlc.
2019-03-15 10:09:17 +01:00
Joost Jager
1f41a2abce
htlcswitch: abtract invoice from link
This commit detaches signaling the invoice registry that an htlc was
locked in from the actually settling of the htlc.

It is a preparation for hodl invoices.
2019-03-15 10:09:15 +01:00
Joost Jager
449c3d533e
contractcourt: add access to full invoice registry from resolvers
Previously a function pointer was passed to chain arbitrator to avoid a
circular dependency. Now that the routetypes package exists, we can pass
the full invoice registry to chain arbitrator.

This is a preparation to be able to use other invoice registry methods
in contract resolvers.
2019-03-15 10:08:35 +01:00
Wilmer Paulino
7946d0a256
multi: remove ErrDoubleSpend check for PublishTransaction
In this commit, we address a lingering issue within some subsystems that
are responsible for broadcasting transactions. Previously,
ErrDoubleSpend indicated that a transaction was already included in the
mempool/chain. This error was then modified to actually be returned for
conflicting transactions, but its callers were not modified accordingly.
This would lead to conflicting transactions to be interpreted as valid,
when they shouldn't be.
2019-03-13 17:57:19 -07:00
Conner Fromknecht
29f07a58cb
cnct+lnwl+hswc: use lntypes.Preimage for witness beacon 2019-02-19 17:06:00 -08:00
Joost Jager
9e012ecc93
multi: move Input interface and related code
This commit is a step to split the lnwallet package. It puts the Input
interface and implementations in a separate package along with all their
dependencies from lnwallet.
2019-01-31 13:25:33 +01:00
Wilmer Paulino
41f638c7cf
contractcourt+server: settle invoice for on-chain HTLC sweep
In this commit, we extend the htlcSuccessResolver to settle the invoice,
if any, of the corresponding on-chain HTLC sweep. This ensures that the
invoice state is consistent as when claiming the HTLC "off-chain".
2019-01-22 20:46:14 -08:00
Wilmer Paulino
974e0f2df5
cnct: make original htlc amt available for contract resolvers
Previously, contract resolvers that needed to publish a second level tx,
did not have access to the original htlc amount.

This commit reconstructs this amount from data that is already persisted
in arbitrator log.

Co-authored-by: Joost Jager <joost.jager@gmail.com>
2019-01-22 20:47:17 -08:00
Joost Jager
4ec3fc3b1a
cnct: split resolvers in separate files 2019-01-16 20:03:59 +01:00