lnd: use a default temporary static fee of 50 sat/byte for BTC

This commit is contained in:
Olaoluwa Osuntokun 2017-05-16 19:12:21 -07:00
parent 75858a604a
commit 67791755af
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 6 additions and 3 deletions

2
lnd.go
View File

@ -149,7 +149,7 @@ func lndMain() error {
signer := wc
bio := wc
fundingSigner := wc
estimator := lnwallet.StaticFeeEstimator{FeeRate: 250}
estimator := lnwallet.StaticFeeEstimator{FeeRate: 50}
// Create, and start the lnwallet, which handles the core payment
// channel logic, and exposes control via proxy state machines.

View File

@ -286,14 +286,17 @@ func assertNumConnections(ctxt context.Context, t *harnessTest,
// calcStaticFee calculates appropriate fees for commitment transactions. This
// function provides a simple way to allow test balance assertions to take fee
// calculations into account.
//
// TODO(bvu): Refactor when dynamic fee estimation is added.
//
// TODO(roasbeef): can remove as fee info now exposed in listchannels?
func calcStaticFee(numHTLCs int) btcutil.Amount {
const (
commitWeight = btcutil.Amount(724)
htlcWeight = 172
feePerByte = btcutil.Amount(250 * 4)
feePerKw = btcutil.Amount(50/4) * 1000
)
return feePerByte * (commitWeight +
return feePerKw * (commitWeight +
btcutil.Amount(htlcWeight*numHTLCs)) / 1000
}