From 67791755afe3289cde5b6d0338d985f88b1596f1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 16 May 2017 19:12:21 -0700 Subject: [PATCH] lnd: use a default temporary static fee of 50 sat/byte for BTC --- lnd.go | 2 +- lnd_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lnd.go b/lnd.go index ef56993a..7a0919a5 100644 --- a/lnd.go +++ b/lnd.go @@ -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. diff --git a/lnd_test.go b/lnd_test.go index 8c0fc59c..d52baaa3 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -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 }