Skip to content

Commit

Permalink
Move fee provider configuration section (#1631)
Browse files Browse the repository at this point in the history
* move and rename fee provider parameters

* set the min-feerate to 1 sat/byte

This only affects the value returned by fee providers, it is
overriden by the other bitcoin-core enforced minimum (currently 253
sat/kiloweight).
  • Loading branch information
pm47 committed Dec 14, 2020
1 parent 0e5ec4d commit e8b47e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions eclair-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ eclair {
zmqtx = "tcp://127.0.0.1:29000"
}

min-feerate = 2 // minimum feerate in satoshis per byte
smooth-feerate-window = 6 // 1 = no smoothing
feerate-provider-timeout = 5 seconds // max time we'll wait for answers from a fee provider before we fallback to the next one

node-alias = "eclair"
node-color = "49daaa"

Expand Down Expand Up @@ -92,6 +88,10 @@ eclair {
fee-proportional-millionths = 100 // fee charged per transferred satoshi in millionths of a satoshi (100 = 0.01%)

on-chain-fees {
min-feerate = 1 // minimum feerate in satoshis per byte
smoothing-window = 6 // 1 = no smoothing
provider-timeout = 5 seconds // max time we'll wait for answers from a fee provider before we fallback to the next one

default-feerates { // those are per target block, in satoshis per kilobyte
1 = 210000
2 = 180000
Expand Down
6 changes: 5 additions & 1 deletion eclair-core/src/main/scala/fr/acinq/eclair/NodeParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ object NodeParams extends Logging {
"global-features" -> "features",
"local-features" -> "features",
// v0.4.1
"on-chain-fees.max-feerate-mismatch" -> "on-chain-fees.feerate-tolerance.ratio-low / on-chain-fees.feerate-tolerance.ratio-high"
"on-chain-fees.max-feerate-mismatch" -> "on-chain-fees.feerate-tolerance.ratio-low / on-chain-fees.feerate-tolerance.ratio-high",
// v0.4.3
"min-feerate" -> "on-chain-fees.min-feerate",
"smooth-feerate-window" -> "on-chain-fees.smoothing-window",
"feerate-provider-timeout" -> "on-chain-fees.provider-timeout"
)
deprecatedKeyPaths.foreach {
case (old, new_) => require(!config.hasPath(old), s"configuration key '$old' has been replaced by '$new_'")
Expand Down
6 changes: 3 additions & 3 deletions eclair-core/src/main/scala/fr/acinq/eclair/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ class Setup(datadir: File,
feeratesPerKw.set(FeeratesPerKw(confDefaultFeerates))
confDefaultFeerates
}
minFeeratePerByte = FeeratePerByte(Satoshi(config.getLong("min-feerate")))
smoothFeerateWindow = config.getInt("smooth-feerate-window")
readTimeout = FiniteDuration(config.getDuration("feerate-provider-timeout", TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS)
minFeeratePerByte = FeeratePerByte(Satoshi(config.getLong("on-chain-fees.min-feerate")))
smoothFeerateWindow = config.getInt("on-chain-fees.smoothing-window")
readTimeout = FiniteDuration(config.getDuration("on-chain-fees.provider-timeout", TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS)
feeProvider = (nodeParams.chainHash, bitcoin) match {
case (Block.RegtestGenesisBlock.hash, _) =>
new FallbackFeeProvider(new ConstantFeeProvider(defaultFeerates) :: Nil, minFeeratePerByte)
Expand Down

0 comments on commit e8b47e1

Please sign in to comment.