Commit Graph

7 Commits

Author SHA1 Message Date
Bjarne Magnussen
59c40ec8b4
chanfunding: fee estimation based on change output in CoinSelect
Add a dust-limit to `CoinSelect` and let the fee estimation consider if a change output is needed or not, assuring that if the change is below the dust-limit it will go towards the fee instead.
2021-04-13 11:37:12 +02:00
Bjarne Magnussen
235e73205d
chanfunding: refactor fee estimate calculation 2021-04-12 14:39:38 +02:00
Bjarne Magnussen
0e2d6dc0a9
chanfunding: match error string when testing CoinSelectSubtractFees 2020-11-04 18:54:57 +01:00
Bjarne Magnussen
c56457c869
chanfunding: add test for a non-zero change 2020-11-04 18:54:57 +01:00
Bjarne Magnussen
07549d50ff
chanfunding: assure logic for high-fee
Without this change the high-fee logic is never tested as it is instead caught by the dust-output logic. This change uses a higher fee rate to ensure an output value above the dust limit, while still spending 20% on fees.
2020-11-04 18:54:57 +01:00
Bjarne Magnussen
9e825e6c0f
chanfunding: assure logic for dust output
Without this change the fee for the test case is above 20% and hence the error could be caught by the high-fee logic instead.
2020-11-04 18:54:57 +01:00
Olaoluwa Osuntokun
9eefdef262
chanfunding+lnwallet: move coin selection code into new chanfunding package
In this commit, we make an incremental change to move the existing coin
selection code into a new chanfunding package. In later commits, this
package will grow to serve all the lower level channel funding needs in
the daemon.
2019-12-02 17:11:25 -06:00