Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 2099d6fa77 contractcourt: ensure we always cancel block epoch notifications after use
In this commit, we fix an existing grouting leak within the contract
court package. If a goroutine dies, but it doesn’t actually cancel the
block epoch notification that it requested, then it’s possible to leak
thousands of gorutines. To remedy this situation, we ensure that we’ll
*always* cancel the epoch notification once the goroutine has exited.
2018-02-05 14:41:08 -08:00
Olaoluwa Osuntokun 30dbbd69a0 funding+htlcswitch: dynamically update short chan id of existing link
In this commit, we fix an existing bug that would result in some
payments getting “stuck”. This would happen if one side restarted
before the channel was fully locked in. In this case, since upon
re-connection, the link will get added to the switch with a *short
channel ID of zero*. If A then tries to make a multi-hop payment
through B, B will fail to forward the payment, as it’ll mistakenly
think that the payment originated from a local-subsystem as the channel
ID is zero. A short channel ID of zero is used to map local payments
back to their caller.

With fix this by allowing the funding manager to dynamically update the
short channel ID of a link after it discovers the short channel ID.

In this commit, we fix a second instance of reported “stuck” payments
by users.
2018-02-03 18:14:15 -08:00
Olaoluwa Osuntokun 71a837630a funding: on startup only re-create funding barriers if channel is pending
In this commit, we fix an existing bug within the funding manager. A
channel barrier only needs to be create if upon startup the channel is
still pending. Otherwise, we’ll re-create the funding barrier
unnecessarily. This can lead to bugs when initiating payments between a
channels’ lock in and when it’s announced to the together network. If
during this period, a user attempts a payment, then the response won’t
be archived, as the grouting will be blocked waiting on the channel
barrier to close.

To fix this, we only re-create the barrier if the channel hasn’t been
confirmed.

This eliminates one source of reported “stuck payments”.
2018-02-03 18:02:21 -08:00
Olaoluwa Osuntokun bb174292b1 lnd: remove redundant server shutdown for REST wallet unlock
In this commit, we remove a server shutdown statement that was executed
after we obtained the wallet’s password from the user over RPC. This
was unnecessary as we already close the listener below. Before this
commit, users would see a weird benign error message. With these code
deletion, the message disappears.
2018-02-03 17:59:03 -08:00
Olaoluwa Osuntokun bba2ff1871 funding: display error if unable to watch for channel 2018-02-02 17:59:38 -08:00
Olaoluwa Osuntokun ddf4715e3c chainntnfs/neutrinonotify: fix regression for historical spend dispatches
In this commit, we fix an issue that was recently introduced to the way
we handle historical dispatches for the neutrino notifier. In a recent
change, we no return an error if we’re unable to actually find the
transaction that spends an outpoint. If this is the case, then the
outpoint is actually unspent, and we should proceed as normal.
2018-02-02 17:59:16 -08:00
Olaoluwa Osuntokun 609525f0e8 Merge pull request #712 from Roasbeef/avoid-dust-change-funding
lnwallet: avoid creating dust change outputs in funding txns
2018-02-01 16:20:52 -08:00
Olaoluwa Osuntokun 7144707734 rpc: store display of alias in getinfo 2018-02-01 11:55:02 -08:00
Olaoluwa Osuntokun 20098e8cb3 lnwallet: update transactions_test.go due to recent API changes 2018-01-31 14:31:14 -08:00
Olaoluwa Osuntokun 43fa9fe467 lnwallet: avoid creating dust change outputs in funding txns
Before this commit, if the remaining change was small enough, then it
was possible for us to generate a non-std funding transaction. This is
an issue as the txn would fail to propagate, meaning funds could
potentially be stuck in limbo if users didn't manually drop their
transaction history.

To avoid this scenario, we won't create a change output that is dusty.
Instead, we'll add these as miner fees.

Fixes #690.
2018-01-31 14:10:45 -08:00
Olaoluwa Osuntokun 94b10c6c06 Merge pull request #593 from AdamISZ/noise_tests
Add tests for key rotation from BOLT8 test vectors
2018-01-31 12:38:58 -08:00
Olaoluwa Osuntokun 1b15c30f7a Merge pull request #592 from wilmerpaulino/rest-close-channel
lnrpc: make ChannelPoint.funding_txid a protobuf oneof and change CloseChannel endpoint
2018-01-31 12:38:03 -08:00
Olaoluwa Osuntokun 1819abf224 lnwallet: increase size of test reservation due to high funding limit 2018-01-28 16:55:11 -08:00
Olaoluwa Osuntokun 3036fc0181 lnwallet: disallow creation of channels < 2x dust limit
Fixes #633.
2018-01-28 15:11:13 -08:00
Olaoluwa Osuntokun 87742ce861 docs: update wording on autopilot.allocation
Fixes #681.
2018-01-28 15:05:41 -08:00
Olaoluwa Osuntokun e953c6abcf config: add stricter config parsing to avoid dangerous RPC auth combos
In this commit, we add an additional constraint to the RPC
configuration parsing. Before this commit, it was possible to start lnd
with either RPC server listening on an external interface *without*
authentication disabled. After this commit, if a user tries to start
the RPC server listening on an external interface without any sort of
RPC authentication, then the daemon will fail to start up.
2018-01-28 15:03:29 -08:00
Olaoluwa Osuntokun 0a4de859a2 discovery+routing: reduce number of active validation barrier jobs
In order to reduce high CPU utilization during the initial network view
sync, we slash down the total number of active in-flight jobs that can
be launched.
2018-01-28 14:55:32 -08:00
Olaoluwa Osuntokun 63fe8aec5b lnwallet: properly use in KB, not KiB to convert to sat/byte for bitcoind estimator
In this commit, we fix an existing bug. The fee estimation within
bitcoind is based on fee/KB (1000), not fee/KiB (1024).

Pointed out by @dabura667.
2018-01-28 14:53:58 -08:00
Olaoluwa Osuntokun 47dc2d3b70 server: grab the read-mutex within the main loop of the peerBootstrapper
A recent commit modified the mutex in the server to the read/write. In
order to further reduce contention, we’ll grab the read lock when we’re
examining get set of peers to ignore.
2018-01-28 14:50:25 -08:00
Olaoluwa Osuntokun a94648e9dc channeldb: properly use a read-transaction in FetchChannelEdgesByOutpoint
Before this commit, we’d unnecessarily use a write transaction within
the FetchChannelEdgesByOutpoint. This is wasteful as the function only
actually reads items from the database, and doesn’t attempt any
mutations at all.
2018-01-28 14:48:57 -08:00
Olaoluwa Osuntokun bde3828208 funding: fix format directive in logging statement 2018-01-28 14:48:56 -08:00
Olaoluwa Osuntokun bf6001074c chainntnfs: fix spend notification registration race condition
In this commit, we fix a race condition related to the way we attempt
to query to see if an outpoint has already been spent by the time it’s
registered within the ChainNotifier. If the transaction creating the
outpoint hasn’t made it into the mempool by the time we execute the
GetTxOut call, then we’ll attempt to query for the transaction itself.
In this case, if we query for the transaction, then the block hash
field will be empty as it hasn’t yet made it into a block. Under the
previous logic, we’d then attempt to force a rescan. This is an issue
as the forced rescan will fail since it’ll try to fetch the block hash
of all zeroes.

In this commit, we fix this issue by only entering this “fallback to
rescan” logic iff, the transaction has actually been mined.
2018-01-28 14:48:56 -08:00
Olaoluwa Osuntokun f9eda8580d Merge pull request #571 from hectorj/patch-1
docker-compose.yml: fix typo
2018-01-27 18:43:38 -08:00
Olaoluwa Osuntokun 859ecbd300 Merge pull request #569 from wilmerpaulino/protobuf-docs
docs: clarify how to generate protobuf definitions
2018-01-27 18:43:12 -08:00
Olaoluwa Osuntokun 42014f5b7b Merge pull request #650 from wilmerpaulino/invoice-negative-amount
invoice: avoid negative msat amounts
2018-01-27 18:34:56 -08:00
Olaoluwa Osuntokun 7919c4cba0 Merge pull request #654 from wilmerpaulino/invoice-without-amount
Support invoices without amount specified
2018-01-27 17:38:56 -08:00
Olaoluwa Osuntokun a808f76a60 Merge pull request #648 from halseth/fix-lost-announcement
gossiper/tests: Integration test bug/flake fixes.
2018-01-27 17:25:51 -08:00
Olaoluwa Osuntokun b6235a536b Merge pull request #587 from kingvest/master
docs/grpc: added instructions for writing gRPC clients in Ruby
2018-01-27 16:31:23 -08:00
Olaoluwa Osuntokun 28f782b156 Merge pull request #663 from cfromknecht/utxn-height-hint
Fix UtxoNursery Commit Sweep Height-Hint
2018-01-27 15:57:03 -08:00
Olaoluwa Osuntokun 1a164db375 cmd/lncli: fix linter error 2018-01-27 15:05:32 -08:00
Olaoluwa Osuntokun d66528c73a Merge pull request #596 from wilmerpaulino/listinvoices-endpoint
lnrpc: avoid lookupinvoice endpoint collision
2018-01-26 13:33:14 -08:00
Olaoluwa Osuntokun eddb8dae0c Merge pull request #655 from cfromknecht/server-locking-improvments
Server: Reduce Contention due to Exclusive Locking
2018-01-26 12:18:27 -08:00
Olaoluwa Osuntokun 4f91b66c51 Merge pull request #467 from bcongdon/feature/customize-alias-and-color
cmd/lncli+lnd: Add alias and color customization
2018-01-24 16:48:36 -08:00
Olaoluwa Osuntokun 7bf057c22e glide: update to latest btcwallet+neutrino+gozmq builds
In this commit, we update all the references to
btcwallet+neutrino+gozmq included in the current build. We do this as a
number of bugs related to the bitcoind backend have been fixed.
2018-01-24 15:35:01 -08:00
Olaoluwa Osuntokun 2d104b7ec0 test: wait for 2 transactions to enter mempool at the end of testMultiHopHtlcRemoteChainClaim
In this commit, we fix an existing flake on Travis related to the new
set of on-chain HTLC tests. In this timing flake, Bob would broadcast
his sweeping transaction, but *mid block mining*. As a result, the
output would never be properly swept, needing an additional block to be
mined. We’ll now wait for both Bob’s sweeping transaction, and Carol’s
sweep transaction to be confirmed before we attempt our assertions.
2018-01-23 19:05:36 -08:00
Olaoluwa Osuntokun 5dc0d669a6 contractcourt: watch proper output within htlcOutgoingContestResolver
In this commit, we fix an existing bug in the implementation of the
resolution of the htlcOutgoingContestResolver. Before this commit, we
would _always_ watch the claim outpoint. However, if this is on the
remote party’s commitment transaction, then we would end up watching
the wrong output. We’ll now properly detect this by modifying which
output we watch, based on if we have a second level transaction or not.
2018-01-23 14:16:22 -08:00
Olaoluwa Osuntokun dd08662c87 test: fix linter error 2018-01-22 21:11:34 -08:00
Olaoluwa Osuntokun d0abb8219c test: wrap assertion in WaitPredicate in testMultiHopReceiverChainClaim 2018-01-22 21:06:39 -08:00
Olaoluwa Osuntokun 99cc4be448 test: extend timeouts for WaitPredicate on new integration tests 2018-01-22 20:37:32 -08:00
Olaoluwa Osuntokun 968e3e953e test: extend timeouts on new on-chain htlc integration tests for travis 2018-01-22 19:58:19 -08:00
Olaoluwa Osuntokun e753078741 README: update BOLT compat language
Fixes #549.
2018-01-22 19:25:12 -08:00
Olaoluwa Osuntokun f8adab1f1c test: add comprehensive integration tests for on-chain HTLC handling
In this commit, we add 6 new integration tests to test the various
actions that may need to be performed when either side goes on-chain to
fully resolve HTLC’s. Many of the tests are mirrors of each other as
they test sweeping/resolving HTLC’s from both commitment transactions.
2018-01-22 19:20:02 -08:00
Olaoluwa Osuntokun a1e2560b12 test: modify force close integration test to account for recent HTLC changes
In this commit, we modify the testChannelForceClosure integration test
to account for the fact that now the HTLCs are only sent to the nursery
once they’ve fully timed out. Additionally, we now send Carol HTLCs
that she doesn’t know the preimage to, so she doesn’t attempt to sweep
them before we can actually time them out.
2018-01-22 19:20:01 -08:00
Olaoluwa Osuntokun 2faafbcd93 breacharbiter: properly account for second-level spends during breach remedy
In this commit, we address an un accounted for case during the breach
remedy process. If the remote node actually went directly to the second
layer during a channel breach attempt, then we wouldn’t properly be
able to sweep with out justice transaction, as some HTLC inputs may
actually be spent at that point.

In order to address this case, we’ll now catch the transaction
rejection, then check to see which input was spent, promote that to a
second level spend, and repeat as necessary. At the end of this loop,
any inputs which have been spent to the second level will have had the
prevouts and witnesses updated.

In order to perform this transition, we now also store the second level
witness script in the database. This allow us to modify the sign desc
with the proper input value, as well as witness script.
2018-01-22 19:20:01 -08:00
Olaoluwa Osuntokun 4e6c816d11 breacharbiter: correct weight estimation for inputs in justice tx
Before this commit, we had the weight estimates flipped. When sweeping
w/o any delay, we’re spending a regular P2WKH output. When we’re
sweeping their CSV delayed output, we’ll using the entire to-local
script, so we need to properly account for that.
2018-01-22 19:20:01 -08:00
Olaoluwa Osuntokun 7b675446f0 breacharbiter: properly accept new incoming channels for watching 2018-01-22 19:20:00 -08:00
Olaoluwa Osuntokun d368bce1da utxonursery: use proper weight estimation for second-level spends 2018-01-22 19:20:00 -08:00
Olaoluwa Osuntokun 96fbc7da84 htlcswitch: fix deadlock during chainWatcher notifications 2018-01-22 19:19:59 -08:00
Olaoluwa Osuntokun d4e650c85d peer: the chancloser no longer needs to notify the breach arb of settled transactions 2018-01-22 19:19:59 -08:00
Olaoluwa Osuntokun 73641d222f contractcourt: properly use the broadcast state number during breach remedy 2018-01-22 19:19:58 -08:00
Olaoluwa Osuntokun 5df6704a9c contractcourt: make synchronous chain watcher notifications optional
In this commit, we modify the way that notifications are dispatched
within the chainWatcher. Before we would *always* wait for an ack back
before we started to clean up he database state. This would at times
lead to deadlocks. To remedy this, we now allow callers to decide if
they want notifications to be sync or not. The only current caller that
requires this is the breach arbiter.
2018-01-22 19:19:58 -08:00
Olaoluwa Osuntokun f85f1f97ca lnwallet: add the second level witness script to the HtlcRetribution
In this commit, we add the second level witness script to the
HtlcRetribution struct. We do this as it’s possible that we when
attempt to sweep funds after a channel breach, then the remote party
has already gone to the second layer. In this case, we’ll then need to
update our SignDesc and also the witness, in order to do that we need
this script that’ll get us pass the second layer P2WSH check.
2018-01-22 19:19:58 -08:00
Olaoluwa Osuntokun 967a9ca7de lnwallet: add new HtlcSecondLevelRevoke witness type
In this commit, we add a new witness type to the set of known types.
This new type will be used when we need to sweep an HTLC that the
remote party has taken to the second level.
2018-01-22 19:19:57 -08:00
Olaoluwa Osuntokun 109e42a567 lnwallet: update OfferedHtlcSuccessWitnessSize to factor in preimage size 2018-01-22 19:19:57 -08:00
Olaoluwa Osuntokun cca0d64ea4 lnwallet: add size estimates for second level HTLC script+spends 2018-01-22 19:19:56 -08:00
Olaoluwa Osuntokun 783f01e1c7 multi: fix linter warnings 2018-01-22 19:19:56 -08:00
Olaoluwa Osuntokun ca613a625f htlcswitch: handleLocalDispatch can now handle locally sourced resolutions
In this commit, we update the failure case within handleLocalDispatch
to handle locally sourced resolutions. This is the case that we send a
payment out, but before it can even get past the first hop, we need to
go to chain (may have been a cascading failure). Once the HTLC is fully
resolved, we’ll send back a resolution message, however, that message
doesn’t have a failure reason populated. To properly handle this, we’ll
send back a permanent channel failure to the router.
2018-01-22 19:19:56 -08:00
Olaoluwa Osuntokun 246ba98f47 cmd/lncli: update the sendpayment usage documentation 2018-01-22 19:19:55 -08:00
Olaoluwa Osuntokun 84c8ed6362 cmd/lncli: expose the final_cltv_delta flag in sendpayment 2018-01-22 19:19:55 -08:00
Olaoluwa Osuntokun 0d75dde153 breacharbiter: also listen for the co-op chan close signal 2018-01-22 19:19:55 -08:00
Olaoluwa Osuntokun 91d45b37ba contractcourt: on startup, launch a goroutine to finalize co-op chan close if needed 2018-01-22 19:19:54 -08:00
Olaoluwa Osuntokun db2b9fd9ff contractcourt: remove the existing ManuallyResolveChannel methiod
We’re removing this method as it’s no longer needed, since the
chainWatcher will properly handle on-chain co-op closes.
2018-01-22 19:19:54 -08:00
Olaoluwa Osuntokun 3ec83cc82f peer+contractcourt: delegate watching for co-op closes to the chainWatcher
In this commit, we modify the interaction between the chanCloser
sub-system and the chain notifier all together. This fixes a series of
bugs as before this commit, we wouldn’t be able to detect if the remote
party actually broadcasted *any* of the transactions that we signed off
upon. This would be rejected to the user by having a “zombie” channel
close that would never actually be resolved.

Rather than the chanCloser watching for on-chain closes, we’ll now open
up a co-op close context to the chainWatcher (via a layer of
indirection via the ChainArbitrator), and report to it all possible
closes that we’ve signed. The chainWatcher will then be able to launch
a goroutine to properly update the database state once any of the
possible closure transactions confirms.
2018-01-22 19:19:53 -08:00
Olaoluwa Osuntokun 1604c75a9c lnwallet: modify CreateCloseProposal to also return the close txid and local balance 2018-01-22 19:19:53 -08:00
Olaoluwa Osuntokun bbca53507f contractcourt: extend the ChainArbitratorConfig with IsOurAddress closure
In this commit, we add the IsOurAddress field into the config of the
chain arb. With this new function closure, the chain arb is able to
detect co-op on chain closes automatically.
2018-01-22 19:19:53 -08:00
Olaoluwa Osuntokun bdbb33344a contractcourt: extend resolveContract to also stop any active chainWatcher 2018-01-22 19:19:52 -08:00
Olaoluwa Osuntokun 723bfb0eac contractcourt: channel arbitrators now exit on co-op close of the channel 2018-01-22 19:19:52 -08:00
Olaoluwa Osuntokun 62f951a969 contractcourt: extend the chainWatcher to be able to detect co-op closes
In this commit, we extend the chainWatcher to be able to automatically
detect co-op closes of the channel. With this change, it’s now fully
encompassed so able to detect all types of closes on-chain. We detect a
co-op close due to the sequence number being finalized, as well as
paying to us directly in a regular p2wkh-like output.
2018-01-22 19:19:52 -08:00
Olaoluwa Osuntokun ebb4c84b32 channeldb: add new LatestCommitments and RemoteRevocationStore methods
These methods will allow the chainWatcher to ensure it has the latest
channel state before attempting to construct any resolution objects.
2018-01-22 19:19:51 -08:00
Olaoluwa Osuntokun 239416f242 htlcswitch: update to use new event stream from the chainWatcher 2018-01-22 19:19:51 -08:00
Olaoluwa Osuntokun 69e6ec9954 peer+funding: remove unneeded channel handoff code with the breach arbiter
We no longer need to hand off new channels that come online as the
chainWatcher will be persistent, and always have an active signal for
the entire lifetime of the channel.
2018-01-22 19:19:50 -08:00
Olaoluwa Osuntokun a0cc1d1b2d breacharbiter: utilize new channel on-chain event stream to watch for breaches
In this commit, we modify the breach arbiter to no longer require
holding a channel object directly in order to receive new notifications
about possible breaches. Instead, we’ll contact the chain arbiter to
request a new channel event subscription.

As a result of the new architecture, we no longer need to receive a
handoff once the new channel comes online, as the chainWatcher will
always be active and watching the channel until it’s been closed.
2018-01-22 19:19:50 -08:00
Olaoluwa Osuntokun defa1bc3e3 peer: when creating new links, obtain an on-chain events subscription 2018-01-22 19:19:49 -08:00
Olaoluwa Osuntokun b5ae0855d2 contractcourt: add new SubscribeChannelEvents method to ChainArbitrator
In this commit, we add a new method to allow external sub-systems to
gain an intent to receive notifications once an on-chain event happens.
This will be used in place of the old channel signals directly on the
channel state machine object in a series of follow up commits.
2018-01-22 19:19:49 -08:00
Olaoluwa Osuntokun 754d1c1c38 contractcourt: when handling a remote force close, use their view of the HTLC's 2018-01-22 19:19:49 -08:00
Olaoluwa Osuntokun 63f7bf4e65 contractcourt: integrate notifications of the chainWatcher with each channel arb
In this commit, we modify the construction of the channel arbitrator to
accept a pointer to an event stream from the chain watcher that’s been
assigned to that channel. As a result, we no longer need a fresh
unilateral close signal, as the one we get from the chain watcher will
*always* be up to date.

For each active channel, we’ll now create a chainWatcher instance that
will be around until the channel is fully closed on chain.
2018-01-22 19:19:48 -08:00
Olaoluwa Osuntokun 0e14ac2063 contractcourt: add new chainWatcher struct
In this commit, we add a new struct to the package, the chainWatcher.
The duty of this struct is to replace the functionality that was
previously implemented by the closeObserver of each channel. Rather
than the source of notification being tied to the lifetime of a
particular object, it’s now delegated to a persistent object that will
be around for the entire lifetime of the channel (until it’s closed).
This will serve to greatly simplify the code, and eliminate a large
class of bugs.
2018-01-22 19:19:48 -08:00
Olaoluwa Osuntokun 5bbe126c34 lnwallet: add new NewUnilateralCloseSummary function
In this commit, we add a new function that allows a caller to create a
UnilateralCloseSummary with the proper materials. This will be used
within a new sub-system to be added in a later commit to properly
dispatch notifications when on-chain events happen for a channel.
2018-01-22 19:19:47 -08:00
Olaoluwa Osuntokun 341c1678fc lnwallet: publicly export NewBreachRetribution 2018-01-22 19:19:47 -08:00
Olaoluwa Osuntokun 30c4196f91 lnwallet: remove the closeObserver from the channel state machine
In this PR, we entirely remove the closeObserver from the channel state
machine. It was added very early on before most of the other aspects of
the daemon were built out. This goroutine was responsible for
dispatching notifications to outside parties if the commitment
transaction was spent at all. This had several issues, since it was
linked to the *lifetime* of the channel state machine itself. As a
result of this linkage, we had to do weird stuff like hand off in
memory pointers to the state machine in order to ensure notifications
were properly dispatched.
2018-01-22 19:19:47 -08:00
Olaoluwa Osuntokun b391049e49 lnd+test: update unit tests to account for recent API changes 2018-01-22 19:19:46 -08:00
Olaoluwa Osuntokun 5758a4e1af nursery_store: reject duplicate registrations for an output 2018-01-22 19:19:46 -08:00
Olaoluwa Osuntokun fc8a6568c9 nursery_store: detect Late Registrations when promoting to kindergarten
In this commit, we aim to address a lingering bug caused by a Late
Registration of a kid output from preschool to kindergarten. In this
scenario, an output is promoted, but *after* it’s target maturity
period, meaning that we won’t graduate the output until we restart. To
avoid this, we’ll now detect this case, and bump the graduation height
by one to ensure that when the new block arrives, we properly handle
the output.
2018-01-22 19:19:45 -08:00
Olaoluwa Osuntokun d0f8b5f194 nursery_store: update IncubateOutputs to take a slice of kid outputs 2018-01-22 19:19:45 -08:00
Olaoluwa Osuntokun 2283960000 utxonursery: update output sweeping to be aware of new output types
In this commit, we modify the logic surrounding sweeping outputs to be
aware of the new types of outputs that the nursery is now responsible
for. Namely: incoming HTLC’s on our commitment transaction as well as
outgoing HTLC’s on the commitment transaction for the remote party. For
 the latter class of HTLC, we’ll now set the lock time on the sweeping
transaction in order to satisfy the CLTV clause in the output we’re
spending.
2018-01-22 19:19:44 -08:00
Olaoluwa Osuntokun fb17f3aeb4 utxonursery: attempt to republish crib transaction on regraduation 2018-01-22 19:19:44 -08:00
Olaoluwa Osuntokun 12babb3cea utxonursery: update NurseryReport with details of new output types
The utxo nursery is now responsible for two additional output types:
outgoing HTLC’s on the commitment transaction of the remote party, and
second-level claim transactions that we broadcast. In this commit,
we’ve updated the NurseryReport to now include details, so users are
able to properly keep track of the status of all their pending coins.
2018-01-22 19:19:44 -08:00
Olaoluwa Osuntokun 13b5019cc6 utxonursery: add new absoluteMaturity field to kid outputs
This new field is reserved for outgoing HTLC outputs on the commitment
transaction of the remote party. These outputs don’t have a CSV delay,
but instead have an absolute maturity time.
2018-01-22 19:19:43 -08:00
Olaoluwa Osuntokun eeb6ab0b17 utxonursery: don't mark channel as fully closed in closeAndRemoveIfMature
The ChannelArbitrator for this channel will do this, so we don’t need
to do it at this point any longer.
2018-01-22 19:19:43 -08:00
Olaoluwa Osuntokun 6568330355 utxonursery: modify IncubateOutputs to accept each output type individually
In this commit, rather than the IncubateOutputs method taking a close
summary entirely, we now take resolutions for each possible output
type. We do this as it’s possible that each output is sent for
incubation at a different time as on-chain conditions change.
Additionally, if we get a baby output (CLTV locked transaction), we’ll
check to see if we can immediately broadcast it. Otherwise, we may
never sweep it unless a restart is attempted.
2018-01-22 19:19:43 -08:00
Olaoluwa Osuntokun e884da4f03 utxonursery: within IncubateOutputs, don't mark channel as fully closed
We no longer need to mark the channel as fully closed as the
ChannelArbitrator for the channel that incubation was requested for
will handle this.
2018-01-22 19:19:42 -08:00
Olaoluwa Osuntokun 24a16b4f49 lnd: properly initialize entities of new contractcourt package 2018-01-22 19:19:42 -08:00
Olaoluwa Osuntokun bfbec1c5d3 rpc: properly pass through the FinalCltvDelta param from the proto 2018-01-22 19:19:42 -08:00
Olaoluwa Osuntokun 5b4b6f9c0e lnrpc: add final_cltv_delta as a SendRequest parameter 2018-01-22 19:19:41 -08:00
Olaoluwa Osuntokun 703057c821 htlcswitch: with debughtlc+hodlhtlc mode, skip all HTLC level checks 2018-01-22 19:19:41 -08:00
Olaoluwa Osuntokun e34850c7af htlcswitch: update tests to account for new API changes 2018-01-22 19:19:41 -08:00
Olaoluwa Osuntokun dbe76a1507 htlcswitch: upon restart, examine all active HTLC's, settle those that we can
In this commit, we address a lingering TODO: before this if we had a
set of HTLC’s that we knew the pre-image to on our commitment
transaction after a restart, then we wouldn’t attempt to settle them.
With this new change, we’ll check that we didn’t already retransmit the
settles for them, and check the preimage cache to see if we already
know the preimage. If we do, then we’ll immediately settle them.
2018-01-22 19:19:40 -08:00
Olaoluwa Osuntokun ca4eb970ec htlcswitch: move channel re-sync into distinct function 2018-01-22 19:19:40 -08:00
Olaoluwa Osuntokun 2d133acaeb htlcswitch: after each new state update, notify callers to set of new HTLC's 2018-01-22 19:19:39 -08:00
Olaoluwa Osuntokun 1418d672f9 htlcswitch: notify the ChainArbitrator of fresh signals upon link creation 2018-01-22 19:19:39 -08:00