ee2f2573c1
In this commit, we correct our size estimates for to-local scripts, which are used on the commitment transaction and the htlc success/timeout transactions. There have been observed cases of transactions getting stuck because our estimates were too low, and cause the transactions to not be relayed. Our previous estimate for the commitment to-local script was derived from an older version of the script. Though the estimate is greater than the actual size, this has been updated with the current estimate of 79 bytes. This estimates makes the assumption that CSV delays will be at most 4 bytes when serialized. Since this value is expressed in relative block heights, this should be more than sufficient for our needs, even though the maximum possible size for the little-endian int64 is 9 bytes (plus an OP_DATA). The other correction is to use the ToLocalScriptSize as our estimate for htlc timeout/success scripts, as they are the same script. Previously, our estimate was derived from the proper script, though we were 6 bytes shy of the new to-local estimate, since we counted the csv_delay as 1 byte, and missed some other OP_DATAs. All derived estimates have been updating depending on the new and improved ToLocalScriptSize estimate, and fix some estimates that did not include the witness length in the estimate. Finally, we correct some weight miscalculations in: - AcceptedHtlcTimeoutWitnessSize: missing data push lengths - OfferedHtlcSuccessWitnessSize: extra 73 byte sig, missing data push lengths - OfferedHtlcPenaltyWitnessSize: missing 33 byte pubkey |
||
---|---|---|
.. | ||
btcwallet | ||
channel_test.go | ||
channel.go | ||
config.go | ||
errors.go | ||
fee_estimator_test.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 | ||
test_utils.go | ||
transactions_test.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 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