Browse Source

cleanup: lowercase name of feerates, immediate -> urgent.

This is only used for logging now, but it gets more important as it
enters the RPC API.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 6 years ago
parent
commit
9d37b78088
  1. 8
      lightningd/chaintopology.c
  2. 2
      lightningd/chaintopology.h
  3. 2
      lightningd/channel_control.c
  4. 2
      lightningd/peer_control.c
  5. 2
      tests/test_closing.py
  6. 2
      tests/test_connection.py

8
lightningd/chaintopology.c

@ -278,8 +278,12 @@ static void watch_for_utxo_reconfirmation(struct chain_topology *topo,
static const char *feerate_name(enum feerate feerate)
{
return feerate == FEERATE_IMMEDIATE ? "Immediate"
: feerate == FEERATE_NORMAL ? "Normal" : "Slow";
switch (feerate) {
case FEERATE_URGENT: return "urgent";
case FEERATE_NORMAL: return "normal";
case FEERATE_SLOW: return "slow";
}
abort();
}
/* Mutual recursion via timer. */

2
lightningd/chaintopology.h

@ -20,7 +20,7 @@ struct peer;
struct txwatch;
enum feerate {
FEERATE_IMMEDIATE, /* Aka: aim for next block. */
FEERATE_URGENT, /* Aka: aim for next block. */
FEERATE_NORMAL, /* Aka: next 4 blocks or so. */
FEERATE_SLOW, /* Aka: next 100 blocks or so. */
};

2
lightningd/channel_control.c

@ -21,7 +21,7 @@
static void update_feerates(struct lightningd *ld, struct channel *channel)
{
u8 *msg;
u32 feerate = try_get_feerate(ld->topology, FEERATE_IMMEDIATE);
u32 feerate = try_get_feerate(ld->topology, FEERATE_URGENT);
/* Nothing to do if we don't know feerate. */
if (!feerate)

2
lightningd/peer_control.c

@ -230,7 +230,7 @@ u32 feerate_max(struct lightningd *ld, bool *unknown)
return UINT_MAX;
/* If we don't know feerate, don't limit other side. */
feerate = try_get_feerate(ld->topology, FEERATE_IMMEDIATE);
feerate = try_get_feerate(ld->topology, FEERATE_URGENT);
if (!feerate) {
if (unknown)
*unknown = true;

2
tests/test_closing.py

@ -894,7 +894,7 @@ def test_onchain_all_dust(node_factory, bitcoind, executor):
# Make l1's fees really high (and wait for it to exceed 50000)
l1.set_feerates((100000, 100000, 100000))
l1.daemon.wait_for_log('Feerate estimate for Normal set to [56789][0-9]{4}')
l1.daemon.wait_for_log('Feerate estimate for normal set to [56789][0-9]{4}')
bitcoind.generate_block(1)
l1.daemon.wait_for_log(' to ONCHAIN')

2
tests/test_connection.py

@ -1146,7 +1146,7 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
# Restart estimatesmartfee, wait for it to pass 5000
l1.set_feerates((15000, 7500, 3750), True)
l1.daemon.wait_for_log('Feerate estimate for Normal set to [567][0-9]{3}')
l1.daemon.wait_for_log('Feerate estimate for normal set to [567][0-9]{3}')
# Can now fund a channel.
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)

Loading…
Cancel
Save