Commit Graph

9 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
777ed104a3
chainfee: create new chainfee package extracting fees from lnwallet
In this commit, we create a new chainfee package, that houses all fee
related functionality used within the codebase. The creation of this new
package furthers our long-term goal of extracting functionality from the
bloated `lnwallet` package into new distinct packages. Additionally,
this new packages resolves a class of import cycle that could arise if a
new package that was imported by something in `lnwallet` wanted to use
the existing fee related functions in the prior `lnwallet` package.
2019-10-31 16:41:57 -07:00
Oliver Gugger
05096b0c2d
input+sweep: log input witness types instead of CSV/CLTV count 2019-10-23 17:09:31 +02:00
Oliver Gugger
fb0051a318
input+sweep: rework witness type into an interface 2019-10-14 15:32:54 +02:00
Olaoluwa Osuntokun
bee777ab5f
input: update CommitSpendNoDelay to be aware of tweakless commits, add new witness type
In this commit, we update the `CommitSpendNoDelay` method to be aware of
the alternate spending mechanism for commitments that don't have a tweak
for the remote party's non-delay output. We also add a new witness type
so callers can convey their expected signing path.
2019-09-25 18:25:37 -07: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
Olaoluwa Osuntokun
4ad175c16d
sweep: update getInputWitnessSizeUpperBound to be aware of nested p2sh
In this commit, we update the `getInputWitnessSizeUpperBound` and all
its callers to be aware of nested p2sh witness inputs. We do so by
adding another bool which is true if the output is a nested p2sh output.
If so, then in order to properly estimate the total weight, the caller
needs to factor in the non-witness data of the additional sigScript data
push.
2019-01-09 15:55:22 -08:00
Olaoluwa Osuntokun
c18e166e03
lnwallet+sweep: extend the WitnessGenerator type to return an InputScript
In this commit, we extend the WitnessGenerator type to now return an
InputScript. This allows it to be more encompassing, as now callers can
expect a sigScript to be populated if the input being swept requires a
sigScript field.

Along the way, we've also renamed input.BuildWitness to
input.CraftInputScript.  We also take a step towards allowing the
sweeper to sweep transactions for n2pwkh outputs. We do so by modifying
the BuiltWitness method to instead return an InputScript. Additionally,
when populating inputs if a sigScript is present, it will now be
populated.
2019-01-09 15:55:19 -08:00
Joost Jager
a2dcca2b08
sweep: add input partitionings generator
This commit adds a function that takes a set of inputs and splits them
in sensible sets to be used for generating transactions.
2018-12-18 10:50:14 +01:00
Joost Jager
067817f6d2
sweep: move tx generation to separate file 2018-12-18 10:50:13 +01:00