Browse Source

peer: don't close due to too low fees if we're already closed.

This fixes half of #59 (the part which crashes).  It doesn't fix the
fact that we should never be doing this for testnet.

Reported-by: Thomas Daede <daede003@umn.edu>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
ab11322b39
  1. 3
      daemon/peer.c

3
daemon/peer.c

@ -3035,7 +3035,8 @@ static enum watch_result anchor_depthchange(struct peer *peer,
* timely manner (see "Risks With HTLC Timeouts").
*/
/* FIXME: BOLT should say what to do if it can't! We drop conn. */
if (peer->local.commit->cstate->fee_rate < get_feerate(peer->dstate)) {
if (!state_is_onchain(peer->state) && !state_is_error(peer->state)
&& peer->local.commit->cstate->fee_rate < get_feerate(peer->dstate)) {
log_broken(peer->log, "fee rate %"PRIu64" lower than %"PRIu64,
peer->local.commit->cstate->fee_rate,
get_feerate(peer->dstate));

Loading…
Cancel
Save