Browse Source

Merge remote-tracking branch 'origin/pr/72'

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
ef4f7c396b
  1. 7
      daemon/chaintopology.c
  2. 9
      daemon/lightningd.c
  3. 5
      daemon/lightningd.h

7
daemon/chaintopology.c

@ -485,7 +485,12 @@ u32 get_block_height(struct lightningd_state *dstate)
u64 get_feerate(struct lightningd_state *dstate)
{
if (dstate->topology->feerate == 0) {
if (dstate->config.override_fee_rate) {
log_debug(dstate->base_log,
"Forcing fee rate, ignoring estimate");
return dstate->config.override_fee_rate;
}
else if (dstate->topology->feerate == 0) {
log_info(dstate->base_log,
"No fee estimate: using default fee rate");
return dstate->config.default_fee_rate;

9
daemon/lightningd.c

@ -127,6 +127,9 @@ static void config_register_opts(struct lightningd_state *dstate)
opt_register_arg("--commit-fee=<percent>", opt_set_u32, opt_show_u32,
&dstate->config.commitment_fee_percent,
"Percentage of fee to request for their commitment");
opt_register_arg("--override-fee-rate", opt_set_u64, opt_show_u64,
&dstate->config.override_fee_rate,
"Force a specific rate in satoshis per kb regardless of estimated fees");
opt_register_arg("--default-fee-rate", opt_set_u64, opt_show_u64,
&dstate->config.default_fee_rate,
"Satoshis per kb if can't estimate fees");
@ -198,6 +201,9 @@ static const struct config testnet_config = {
/* We offer to pay 5 times 2-block fee */
.commitment_fee_percent = 500,
/* Use this rate, if specified, regardless of what estimatefee says. */
.override_fee_rate = 0,
/* Use this rate by default if estimatefee doesn't estimate. */
.default_fee_rate = 40000,
@ -256,6 +262,9 @@ static const struct config mainnet_config = {
/* We offer to pay 5 times 2-block fee */
.commitment_fee_percent = 500,
/* Use this rate, if specified, regardless of what estimatefee says. */
.override_fee_rate = 0,
/* Use this rate by default if estimatefee doesn't estimate. */
.default_fee_rate = 40000,

5
daemon/lightningd.h

@ -37,7 +37,10 @@ struct config {
/* Percent of fee rate we'll use. */
u32 commitment_fee_percent;
/* Force a partiular fee rate regardless of estimatefee (satoshis/kb) */
u64 override_fee_rate;
/* What fee we use if estimatefee fails (satoshis/kb) */
u64 default_fee_rate;

Loading…
Cancel
Save