9a76b3ee58
This commit fixes a nasty bug that has been lingering within lnd, and has been noticed due to the added retransmission logic. Before this commit, upon a restart, if we had an active HTLC and received a new commitment update, then we would re-forward ALL active HTLC’s. This could at times lead to a nasty cycle: * We re-forward an HTLC already processed. * We then notice that the time-lock is out of date (retransmitted HTLC), so we go to fail it. * This is detected as a replay attack, so we send an UpdateMalformedHTLC * This second failure ends up creating a nil entry in the log, leading to a panic. * Remote party disconnects. * Upon reconnect we send again as we need to retransmit the changes, this goes on forever. In order to fix this, we now ensure that we only forward HTLC’s that have been newly locked in at this next state. With this, we now avoid the loop described above, and also ensure that we don’t accidentally attempt an HTLC replay attack on our selves. Fixes #528. Fixes #545. |
||
---|---|---|
.. | ||
btcwallet | ||
channel_test.go | ||
channel.go | ||
config.go | ||
fee_estimator.go | ||
interface_test.go | ||
interface.go | ||
log.go | ||
parameters.go | ||
README.md | ||
reservation.go | ||
script_utils_test.go | ||
script_utils.go | ||
signdescriptor_test.go | ||
signdescriptor.go | ||
sigpool.go | ||
size_test.go | ||
size.go | ||
txout_test.go | ||
txout.go | ||
wallet.go | ||
witnessgen.go |
lnwallet
The lnwallet package implements an abstracted wallet controller that is able to drive channel funding workflows, a number of script utilities, witness generation functions for the various Lightning scripts, revocation key derivation, and the commitment update state machine.
The package is used within lnd
as the core wallet of the daemon. The wallet
itself is composed of several distinct interfaces that decouple the
implementation of things like signing and blockchain access. This separation
allows new WalletController
implementations to be be easily dropped into
lnd
without disrupting the code base. A series of integration tests at the
interface level are also in place to ensure conformance of the implementation
with the interface.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/lnwallet