|
|
@ -1671,47 +1671,6 @@ void htlcs_notify_new_block(struct lightningd *ld, u32 height) |
|
|
|
} while (removed); |
|
|
|
} |
|
|
|
|
|
|
|
static void update_feerates(struct lightningd *ld, struct channel *channel) |
|
|
|
{ |
|
|
|
u8 *msg = towire_channel_feerates(NULL, |
|
|
|
get_feerate(ld->topology, |
|
|
|
FEERATE_IMMEDIATE), |
|
|
|
feerate_min(ld), |
|
|
|
feerate_max(ld)); |
|
|
|
subd_send_msg(channel->owner, take(msg)); |
|
|
|
} |
|
|
|
|
|
|
|
void try_update_feerates(struct lightningd *ld, struct channel *channel) |
|
|
|
{ |
|
|
|
/* No point until funding locked in */ |
|
|
|
if (!channel_fees_can_change(channel)) |
|
|
|
return; |
|
|
|
|
|
|
|
/* Can't if no daemon listening. */ |
|
|
|
if (!channel->owner) |
|
|
|
return; |
|
|
|
|
|
|
|
update_feerates(ld, channel); |
|
|
|
} |
|
|
|
|
|
|
|
void notify_feerate_change(struct lightningd *ld) |
|
|
|
{ |
|
|
|
struct peer *peer; |
|
|
|
|
|
|
|
/* FIXME: We should notify onchaind about NORMAL fee change in case
|
|
|
|
* it's going to generate more txs. */ |
|
|
|
list_for_each(&ld->peers, peer, list) { |
|
|
|
struct channel *channel = peer_active_channel(peer); |
|
|
|
|
|
|
|
if (!channel) |
|
|
|
continue; |
|
|
|
|
|
|
|
/* FIXME: We choose not to drop to chain if we can't contact
|
|
|
|
* peer. We *could* do so, however. */ |
|
|
|
try_update_feerates(ld, channel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#if DEVELOPER |
|
|
|
static void json_dev_ignore_htlcs(struct command *cmd, const char *buffer, |
|
|
|
const jsmntok_t *params) |
|
|
|