Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun c4e43dbaa2 server: avoid nil pointer deference within OutboundPeerConnected 2017-08-15 17:49:35 -07:00
Olaoluwa Osuntokun 06782ebdb3 Merge pull request #225 from halseth/channel-close-negotiation2
Add fee negotiation on channel cooperative shutdown.
2017-08-14 17:48:05 -07:00
Olaoluwa Osuntokun 48be9261ef autopilot: fix linter error 2017-08-10 22:07:22 -07:00
Olaoluwa Osuntokun 143e7bdf5f test: ensure nodes spun up by test framework use fresh config files
This commit modifies the way the nodes spun up the by test framework
are created such that they don’t use the configuration parameters
storage in the normal lnd home directory. Otherwise, tests would pick
up the configuration of the user’s pre-existing lnd nodes.
2017-08-10 22:00:53 -07:00
Olaoluwa Osuntokun c02710c8c9 test: add +build !rpctest to tests files in main package
This commit adds the +build !rpctest build flag to the test files in
the main package other than the RPC tests. With this, if the protest
build flag is set, then ONLY those tests will be run.
2017-08-10 21:59:23 -07:00
Olaoluwa Osuntokun 512a5c899b rpc: only set balance params when force closing if output not dust
This commit fixes an existing bug that would cause a force closed
channel to stay pending forever. In this instance, if one force closes
a channel while they have a dust output, and restart before the channel
is fully closed, then it wouldn’t have been closed automatically
(within the database) by the autopilot agent.
2017-08-10 21:43:17 -07:00
Olaoluwa Osuntokun ece1d09a9f lnd: initialize an autopilot.Agent instance if set in the config file 2017-08-10 21:40:16 -07:00
Olaoluwa Osuntokun ba5ed9e8d2 log: add logger for the autopilot package 2017-08-10 21:39:47 -07:00
Olaoluwa Osuntokun 8dd4245d43 pilot: implement necessary interfaces to drive an autopilot.Agent
This commit adds a new file to the repo: pilot.go. This files contains
the items necessary to configure, and initialize an instance of
autopilot.Agent with the passed configuration struct.
2017-08-10 21:39:11 -07:00
Olaoluwa Osuntokun 629793a249 config: add configuration options for autopilot mode 2017-08-10 21:26:52 -07:00
Olaoluwa Osuntokun 472d9967e5 server: fix some minor style deviations in new server code 2017-08-10 21:20:54 -07:00
Olaoluwa Osuntokun bee7ed7758 server: re-introduce the quit channel to the server
This commit re-introduces the quit channel to the server as an upcoming
addition needs to synchronize its shutdown with the lifetime of the
server.
2017-08-10 21:19:00 -07:00
Olaoluwa Osuntokun 947544753f server: use %x (hex encoding) when logging peer's pub key 2017-08-10 21:17:07 -07:00
Olaoluwa Osuntokun e10388fc53 funding: increase timeout for TestFundingManagerRestartBehavior test 2017-08-10 21:16:10 -07:00
Olaoluwa Osuntokun 8abba7eafc channeldb: add TODO to add storage for onion adds 2017-08-10 21:15:55 -07:00
Olaoluwa Osuntokun 671f15383b chainntnfs: fix a typo 2017-08-10 21:15:38 -07:00
Olaoluwa Osuntokun 306c4aef8e autopilot: "Look ma no hands!", introducing autopilot mode
This commit introduces the initial implementation of the autopilot
mode. Autopilot is new mode within lnd that enables automatic channel
management. This means that if enabled lnd will attempt to
automatically manage channels according to a set of heuristic defined
within the main configuration for autopilot.Agent instance.

The autopilot.Agent implements a simple closed control loop. It takes
in external signals such as wallet balance updates, new open channel,
and channels that are now closed the updates its internal state. With
each external trigger it will consult the registered
AttachmentHeuristic to decide: if it needs to open any more channels,
and if so how much it should use to open the channels, ultimately
returning a set of recommended AttachmentDirectives. The
autopilot.Agent loop will then take those attempt to establish
connection, and go back in waiting for a new external signal.

With this first implementation the default heuristic is the
ConstrainedPrefAttachment implementation of AttachmentHeuristic. Given
a min and max channel size, a limit on the number of channels, and the
percentage of wallet funds to allocate to channels, it will attempt to
execute a heuristic drive by the Barabási–Albert model model in order
to attempt to drive the global graph towards a scale free topology.

This is commit implements a foundational layer for future simulations,
optimization, and additional heuristics.
2017-08-10 21:14:55 -07:00
Olaoluwa Osuntokun a2545d85dc peer: ensure goroutine launched during initial handshake exits
This commit fixes a bug which was covered by the recent server
refactoring wherein the grouting would be stuck on the send over the
message channel in the case that the handshake failed. This blockage
would create a deadlock now that the ConnectToPeer method is full
synchronous.

We fix this issue by ensuring the goroutine properly exits.
2017-08-10 18:07:54 -07:00
Olaoluwa Osuntokun f13c81eb6a test: ensure all tests adhere to maximum funding amount 2017-08-07 16:31:32 -07:00
Olaoluwa Osuntokun 203d038b71 funding: enforce the 2^24 satoshi funding limit in BOLT-0002 2017-08-07 16:31:25 -07:00
Olaoluwa Osuntokun 8cda421784 lnwire: add new error code for rejecting a channel that's too large 2017-08-07 16:31:22 -07:00
Olaoluwa Osuntokun d38b4471c2 server: if a fresh announcement is requested, ensure seqno increases 2017-08-07 16:31:20 -07:00
Olaoluwa Osuntokun 3557274142 test: in testGraphTopologyNotifications only expect 3 notifications
This commit updates the integration tests to reflect the reality after
removing code that would always attempt to increment the current update
timestamp by one for each channel announcement. Without connecting
directly to carol, it isn’t guaranteed that Alice will receive that
announcement as Bob would have already processed one for Carol when
their channel was created.
2017-08-04 18:34:18 -07:00
Olaoluwa Osuntokun 43b736225b multi: add new method to generate fresh node announcments 2017-08-04 18:32:33 -07:00
Olaoluwa Osuntokun 6307f7243e rpc: ensure db is updated on force close if no outputs to sweep
This commit fixes an issue where if a party force closing a channel,
doesn’t have a non-dust balance, nor any outgoing HTLC’s, then the
channel would never be marked as fully closed within the database.

We ensure that this case is addressed, by inserting a checking to
determine if we have any funds to sweep, marking the channel fully
closed on initial commitment transaction confirmation if not.
2017-08-04 18:29:22 -07:00
Olaoluwa Osuntokun cc96f2947a nodesigner: make fully copy of key to avoid mutation 2017-08-04 18:27:21 -07:00
Olaoluwa Osuntokun 0d4ee08372 htlcswitch: asynchronously handle channel close requests
This commit modifies how the htlcswitch handles close requests.
Previously it could be the case that a new channel was added, but at
the same time a channel was requested to be closed. This would result
in a circular waiting dependency: the peer contacts the switch, who
tries to contact the peer.

We eliminate this possibility by ensuring that the switch handles all
close requests asynchronously. With this, the switch won't block
indefinitely in the scenario described above.
2017-08-03 16:59:16 -07:00
Olaoluwa Osuntokun d39410cc01 rpc: wrap canceling a breach watch in a select case 2017-08-03 16:40:15 -07:00
Olaoluwa Osuntokun c183e8984c peer: properly clean up chanMsgStreams map on readHandler exit
This commit ensures that all references within the chanMsgStreams are
all removed and deleted when the readHandler exits. This ensures that
all objects don’t have extra references, and will properly be garbage
collected.
2017-08-03 13:52:12 -07:00
Olaoluwa Osuntokun 36f4e2046d peer: ensure mutex is freed up when the msgConsumer exits 2017-08-03 13:50:34 -07:00
Olaoluwa Osuntokun b1205e71ec htlcswitch: expect proper error in TestChannelLinkExpiryTooSoonMidNode 2017-08-02 21:30:32 -07:00
Olaoluwa Osuntokun 8369ae9b92 build: update glide files to point to latest neutrino build 2017-08-02 21:22:08 -07:00
Olaoluwa Osuntokun 16462e1d57 chains: specify a default CLTV expiration of 1 day equiv for each chain 2017-08-02 21:18:54 -07:00
Olaoluwa Osuntokun a709164aef rpc: populate the expiry field within marshalRoute 2017-08-02 21:18:21 -07:00
Olaoluwa Osuntokun 79e68a2fdf peer: properly initialize ChannelLink with new block+height info 2017-08-02 21:15:57 -07:00
Olaoluwa Osuntokun c14eaa7b6c lnrpc: add expiry field to the Hop proto within a Route 2017-08-02 21:13:51 -07:00
Olaoluwa Osuntokun e6e4742b92 htlcswitch: add tests to exercise new HTLC expiry policies 2017-08-02 21:13:16 -07:00
Olaoluwa Osuntokun cdb7436e34 htlcswitch: update tests to account for new HTLC expiry observence 2017-08-02 21:11:40 -07:00
Olaoluwa Osuntokun ee1acb1610 htlcswitch: reject HTLC's which expire too soon
This commit implements a missing policy within the current ChannelLink
interface. If an HTLC arrives that is too close to the current block
height, then we’ll reject it. As otherwise, it may be possible for us
to lose an on-chain claim if they HTLC expires already or expires
before we’re able to get a commitment transaction in the chain.

As the exit node, we have a grace period that governs out decision. As
an intermediate node, we ensure that the HTLC isn’t close to expiry on
our outgoing link end if we forward it.
2017-08-02 21:10:43 -07:00
Olaoluwa Osuntokun 8c3441b30f routing: update test to account for proper time locks 2017-08-02 21:07:35 -07:00
Olaoluwa Osuntokun 67f17b319a routing: invalidate routing cache on each new block
This commit makes the routing cache invalidation a bit more aggressive.
We now invalidate the cache on each new block as the routes in the
cache are based on the current block height. Using the cached items may
cause our routes to fail due to them having time locks which have
already expired.
2017-08-02 21:07:06 -07:00
Olaoluwa Osuntokun f61d977176 routing: obtain current height when creating a new route 2017-08-02 21:02:24 -07:00
Olaoluwa Osuntokun d331ddd2f4 routing: when creating a route, base time locks off current height
This commit implements some missing functionality, namely before all
time locks were calculated off of a base height of 0 essentially.
That’s incorrect as all time locks within HTLC’s would then be already
expired. We remedy this requesting the latest height when creating a
route to ensure that our time locks are set properly.
2017-08-02 21:01:54 -07:00
Olaoluwa Osuntokun cfa45c15f7 test: add a select statement to avoid error if lnd is shutting down 2017-08-02 21:00:26 -07:00
Olaoluwa Osuntokun 006dff1207 rpc: ensure that calls that depend server are rejected if server not active
This commit adds a bit of a guard to a set of RPC calls. If an RPC call
needs to interact with the server but it hasn’t yet been started. Then
we’ll exit early in order to avoid blocking the call until the server
itself has started.

A recent change to the initialization order of sub-systems within lnd
results in a state where the daemon will wait for the wallet itself to
finish syncing _before_ the server is started. This was interpreted as
a bug by some users, so we’ll make the state of the server more
explicit by returning an error.
2017-08-02 20:59:51 -07:00
Olaoluwa Osuntokun c2aafe7e51 server: add a method to query if the server has started
This commit adds a new utility method to the server struct itself. This
method will allow callers to query the state of the server in order to
decide if the server has been started or not. This can be useful
elsewhere in the project as we start to decouple the lifetime of
certain sub-systems from others.
2017-08-02 20:56:34 -07:00
Olaoluwa Osuntokun 91e14497bb brontide: add a test case to exercise all BOLT-0008 test vectors 2017-08-01 17:18:05 -07:00
Olaoluwa Osuntokun e375a308b9 brontide: add EphemeralGenerator as a functional arg to NewBrontideMachine
This commit modifies the NewBrontideMachine constructor to allow a
caller to specify exactly _how_ new ephemeral private keys for the
crypto handshake are generated. This allows callers a bit more
flexibility when using brontide, and also allow test cases to insert
specific public keys for use within the hand shake.
2017-08-01 17:16:36 -07:00
Olaoluwa Osuntokun 399d9c974f chainntnfs: ensure ntfn cancellation loop will exit
This commit fixes a slight bug introduced. We now ensure that the
cancel loop always exists if the ChainNotifier has been signaled for a
quit.
2017-08-01 17:14:11 -07:00
Olaoluwa Osuntokun b6057abe93 hltcswitch: increase timeout for bi-di payment test due to travis slowness
This commit temporary increases the timeout for the
TestChannelLinkBidirectionalOneHopPayments test in order to account for
the slowness of the travis instances that our tests are run on.
2017-08-01 12:53:17 -07:00
Olaoluwa Osuntokun 0377a4f99d peer: ensure the chanMsgStream for a channel exists on peer d/c 2017-07-31 21:31:24 -07:00
Olaoluwa Osuntokun c47408119e peer: abandon the prior activeChanStreams scheme in favor of chanMsgStream
This commit fixes a bug that existed in the prior scheme we used to
synchronize between the funding manager and the peer’s readHandler.
Previously, it was possible for messages to be re-ordered before the
reached the target ChannelLink. This would result in commitment
failures as the state machine assumes a strict in-order message
delivery. This would be manifested due to the goroutine that was
launched in the case of a pending channel funding.

The new approach using the chanMsgStream is much simpler, and easier to
read. It should also be a bit snappier, as we’ll no longer at times
create a goroutine for each message.
2017-07-31 21:25:54 -07:00
Olaoluwa Osuntokun 5e4b368348 peer: introduce chanMsgStream to provide a concurrent safe, in-order stream of msgs 2017-07-31 21:20:42 -07:00
Olaoluwa Osuntokun 5425eff09c multi: ensure all lnwallet.LightningChannel's are stopped
This commit ensures that we always clean up the resources that are
created when a new instance of a lnwallet.LightningChannel is
instantiated. The is necessary due to the sigPool that’s now present as
an internal goroutine.
2017-07-31 21:07:02 -07:00
Olaoluwa Osuntokun f963859524 funding+peer: rename processFundingResponse to processFundingAccept 2017-07-31 21:04:58 -07:00
Olaoluwa Osuntokun 812ebe6fe6 lnwallet: type htlcWeight and commitWeight as int64's 2017-07-31 21:02:30 -07:00
Olaoluwa Osuntokun 5240953de0 lnwallet: temporarily ensure TestStateUpdatePersistence doesn't make dust
Note that this commit is temporary, and should be reverted once #231 is
merged. The reason we need to do this for now, is that we don’t
properly track the exact state of the remote party’s commitment. In
this test case, the resulting HTLC’s added are dust to one party, but
non-dust to another. So upon restart, the states (balance wise) has
diverged.
2017-07-31 20:53:08 -07:00
Olaoluwa Osuntokun 8c6a83a67d lnwallet: account for second-level HTLC fee in TestChannelBalanceDustLimit 2017-07-31 20:50:54 -07:00
Olaoluwa Osuntokun 4aacf2b51d lnwallet: ensure TestHTLCDustLimit also asserts for bob's commit chain 2017-07-31 20:50:12 -07:00
Olaoluwa Osuntokun 350e6d5c9f lnwallet: extend TestDustHTLCFees to ensure dust HTLC's go to miners 2017-07-31 20:49:13 -07:00
Olaoluwa Osuntokun 00ca97c789 lnwallet: in TestForceClose properly assign Bob's balance 2017-07-31 20:44:22 -07:00
Olaoluwa Osuntokun 1b61341410 lnwallet: when creating channels in tests, properly account for commitment fee 2017-07-31 20:43:38 -07:00
Olaoluwa Osuntokun db793991ac lnwallet: don't add trimmed HTLC value to initiator commitment fees
This commit fixes a lingering bug in the way the internal channel state
machine handled fee calculation. Previously, we would count the dust
HTLC’s that were trimmed towards the fee that the initiator paid. This
is invalid as otherwise, the initiator would always benefit from dust
HTLC’s. Instead, we now simply “donate” the dust HTLC’s to the miner in
the commitment transaction. This change puts us in compliance with
BOLT-0003.
2017-07-31 20:41:23 -07:00
Olaoluwa Osuntokun 5ece7fec2d lnwallet: add a String() method to updateType 2017-07-31 20:37:51 -07:00
Olaoluwa Osuntokun 628c5cd63a features: add a new feature bit for recent changes 2017-07-30 20:27:56 -07:00
Olaoluwa Osuntokun 0f2fcf68b2 test: update testChannelFundingPersistence to use --defaultchanconfs 2017-07-30 20:26:38 -07:00
Olaoluwa Osuntokun fa3fd9a19a test: update integration tests framework API usage to recent change
OpenPendingChannel and OpenChannel no longer take a number of
confirmations as a parameter.
2017-07-30 20:24:54 -07:00
Olaoluwa Osuntokun d4a5eaa6ad lnwallet: modify CommitSpendNoDelay to directly craft witness
This commit modifies the CommitSpendNoDelay script witness generation
function. We must modify this function as all non-delayed outputs now
also require a key derivation. The current default
signer.ComputeInputScript implementation is unable to directly look up
the public key required as it attempt to target the pub key using the
pkScript.
2017-07-30 20:23:31 -07:00
Olaoluwa Osuntokun e840f43db4 build: update glide to track latest lightning-onion commit 2017-07-30 20:22:21 -07:00
Olaoluwa Osuntokun 828c650bbc config: add new command line param --defaultchanconfs
This commit adds a new command line option that allows clients to
specify a default value to use when responding to a new channel funding
request. In a future change, a pure mapping will be added, with the
command line option having higher precedence.
2017-07-30 20:21:51 -07:00
Olaoluwa Osuntokun 747e0f57d1 multi: fix linter errors 2017-07-30 18:22:45 -07:00
Olaoluwa Osuntokun 563fac84cc breacharbiter: sweep commitment output in case of unilateral close
This commit adds a new responsibility to the breach arbiter: the
service is now responsible for sweeping the commitment outputs to-self,
in the case of a unilateral commitment broadcast by the remote party.
In this new commitment design, this output won’t be immediately
recognized by the wallet due to using a tweaked public key. As a
result, we need to sweep this output into the wallet manually.
2017-07-30 17:52:32 -07:00
Olaoluwa Osuntokun 8eadd09403 htlcswitch: add additional logging statement when forwarding HTLC's 2017-07-30 17:52:25 -07:00
Olaoluwa Osuntokun 07b0604458 lnwallet: add TweakPubKeyWithTweak helper function
This commit adds a new helper function which is identical to
TweakPubkey, but lets the caller specify their own hash tweak.
2017-07-30 17:52:22 -07:00
Olaoluwa Osuntokun 899fa1ea3e lnwallet: properly populate the signDesc within UnilateralCloseSummary
This commit modifies the closeObserver code to populate the signDesc in
the case we have a non-trimmed balance. Additionally, we now also add a
*wire.OutPoint field to the struct in order to allow receivers of the
message to construct a witness that can spend the newly created output
to their wallet.
2017-07-30 17:52:18 -07:00
Olaoluwa Osuntokun 8a23de5303 lnwallet: consult current state instead of revocation log during unilateral closure 2017-07-30 17:52:14 -07:00
Olaoluwa Osuntokun db10772bd0 lnd: add initial skeleton functions for RequiredRemoteDelay+ NumRequiredConfs 2017-07-30 17:52:11 -07:00
Olaoluwa Osuntokun a73589f3e9 lnd: properly initialize LightningWallet with new config 2017-07-30 17:52:07 -07:00
Olaoluwa Osuntokun 522712b9a6 breacharbiter: update wallet/signer API usage to due recent changes 2017-07-30 17:52:04 -07:00
Olaoluwa Osuntokun 458138f6fa utxonursery: update serialization, API usage for recent SignDescriptor changes 2017-07-30 17:52:00 -07:00
Olaoluwa Osuntokun 07212588fc funding: update funding workflow to adhere to BOLT-0002
This commit updates the main single-funder funding workflow within the
fundingManager (initiated via the rpcserver or by a message from a
connected peer) to fully adhere to the funding protocol outlined in
BOLT-0002.

The major changes are as follows:
  * All messages modified to use the new funding messages in BOLT-0002.
  * The initiator of a funding workflow no longer decides how many
confirmations must elapse before the channel can be considered open.
  * Rather than each side specifying their desired CSV delay, both
sides now specify the CSV delay for the _other_ party.
2017-07-30 17:51:57 -07:00
Olaoluwa Osuntokun 216cc3f919 test: update open channel methods in the testing framework 2017-07-30 17:51:54 -07:00
Olaoluwa Osuntokun 5ed9375e94 rpcserver: update RPC function impls to account for new API changes 2017-07-30 17:51:51 -07:00
Olaoluwa Osuntokun 0dfe73386b Cmd/lncli: remove num_confs as a param to the openchannel command 2017-07-30 17:51:48 -07:00
Olaoluwa Osuntokun 43b40c2ba2 lnrpc: remove num_confs as a parameter within OpenChannelRequest
This commit removes the num_confs parameter within the
OpenChannelRequest struct as it’s no longer applicable with the new
funding workflow. In the new funding workflow, it’s the responder that
decides how many confirmations are required.
2017-07-30 17:51:44 -07:00
Olaoluwa Osuntokun 34bb0ec36f server: within peerTerminationWatcher exit early if daemon is exiting 2017-07-30 17:51:41 -07:00
Olaoluwa Osuntokun cd7b3290a8 peer: modify channel closing negotiation to create new delivery scripts
This commit modifies the channel close negotiation workflow to instead
take not of the fat that with the new funding workflow, the delivery
scripts are no longer pre-committed to at the start of the funding
workflow. Instead, both sides present their delivery addresses at the
start of the shutdown process, then use those to create the final
cooperative closure transaction.

To accommodate for this new change, we now have an intermediate staging
area where we store the delivery scripts for both sides.
2017-07-30 17:51:37 -07:00
Olaoluwa Osuntokun 01fe9adff0 peer: update logWireMessage to account for new lnwire messages 2017-07-30 17:51:34 -07:00
Olaoluwa Osuntokun 976dcb7b97 htlcswitch: update TestChannelLinkSingleHopMessageOrdering to ignore rev window 2017-07-30 17:51:31 -07:00
Olaoluwa Osuntokun 1d771eeb1b htlcswitch: ensure payments in TestChannelLinkBidirectionalOneHopPayments aren't dust
This commit modifies the TestChannelLinkBidirectionalOneHopPayments
test to ensure that each payment sent is safely above the dust
threshold. Note that the dust threshold itself is now higher due to the
existence of the HTLC covenant transactions which the HTLC values
themselves must cover.

This change ensure that this test operates under “normal” operation
conditions in order to catch any bugs introduced during a major change.
2017-07-30 17:51:27 -07:00
Olaoluwa Osuntokun f8e536dff5 htlcswitch: update messageToString helper test func to new msgs 2017-07-30 17:51:23 -07:00
Olaoluwa Osuntokun 402112e6ee htlcswitch: update tests utilities to be aware of new commitment design 2017-07-30 17:51:20 -07:00
Olaoluwa Osuntokun 2d1a598b66 htlcswitch: modify channelLink to use new create+verify commitment API 2017-07-30 17:51:16 -07:00
Olaoluwa Osuntokun f7c4237686 htlcswitch: remove initial revocation window extension in channelLink
We can safely remove the initial revocation window extension as this
has gone away with the new state machine. We instead now just fill the
window once the channel has been opened, and then maintain a fixed
window size of 2 from there on.
2017-07-30 17:51:13 -07:00
Olaoluwa Osuntokun 6ad9d218b0 lnwallet: update all channel unittests due to new commitment design 2017-07-30 17:51:09 -07:00
Olaoluwa Osuntokun 8121bc77ce lnwallet: add delivery scripts as a param to CreateCloseProposal+ CompleteCooperativeClose
This commit modifies the methods that transition the state of the
channel into an active closing state. With the new commitment design,
the delivery scripts are no longer pre-committed to the initial funding
messages. Instead, the scripts are sent at the instant that either side
decides to shutdown within the Shutdown message.
2017-07-30 17:51:05 -07:00
Olaoluwa Osuntokun 40e9120c04 lnwallet: populate HTLC resolutions after observing a unilateral channel close 2017-07-30 17:51:02 -07:00
Olaoluwa Osuntokun 01aa4eb2ae lnwallet: populate HTLC resolutions within the ForceCloseSummary 2017-07-30 17:50:59 -07:00
Olaoluwa Osuntokun 83e0116d7e lnwallet: extend the UnilateralCloseSummary to include HTLC resolutions
This commit adds a new companion struct: OutgoingHtlcResolution to the
commitment state machine. The purpose of this struct is the provide the
caller with the information necessary to sweep all outgoing HTLC’s in
the case of a broadcast up-to-date commitment transaction.

The HTLC resolutions allow a caller to sweep an outgoing HTLC into
their wallet after the absolute timeout of the HTLc has passed. This is
a two step process, with the first portion consisting of broadcasting
the HTLC timeout transaction itself, and the second portion consisting
of claiming the HTLC itself after a CSV delay.
2017-07-30 17:50:55 -07:00
Olaoluwa Osuntokun a4c07d061e lnwallet: the BreachRetribution struct is now aware of HTLC outputs
This commit adds awareness of active HTLC outputs to the
BreachRetribution struct. Previously, in the case of a breach, the
struct was only populated with enough information to sweep the two
commitment outputs. With this commit, the struct now has enough
information to sweep _all_ outputs within the commitment transaction.
2017-07-30 17:50:51 -07:00