Browse Source

onchaind: don't free proposal, correctly check it's not resolved in billboard.

Instead of freeing proposals, which we did in *some* places, we just
set ->resolved and check that in billboard_update which didn't get it right.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 6 years ago
parent
commit
2945b25b57
  1. 11
      onchaind/onchaind.c

11
onchaind/onchaind.c

@ -514,12 +514,10 @@ static void proposal_meets_depth(struct tracked_output *out)
onchain_txtype_to_wallet_txtype(out->proposal->tx_type))));
/* Don't wait for this if we're ignoring the tiny payment. */
if (out->proposal->tx_type == IGNORING_TINY_PAYMENT) {
if (out->proposal->tx_type == IGNORING_TINY_PAYMENT)
ignore_output(out);
out->proposal = tal_free(out->proposal);
}
/* We will get a callback when it's in a block. */
/* Otherwise we will get a callback when it's in a block. */
}
static void propose_resolution(struct tracked_output *out,
@ -637,9 +635,6 @@ static bool resolved_by_proposal(struct tracked_output *out,
out->resolved->depth = 0;
out->resolved->tx_type = out->proposal->tx_type;
/* Don't need proposal any more */
out->proposal = tal_free(out->proposal);
return true;
}
@ -760,7 +755,7 @@ static void billboard_update(struct tracked_output **outs)
/* Highest priority is to report on proposals we have */
for (size_t i = 0; i < tal_count(outs); i++) {
if (!outs[i]->proposal)
if (!outs[i]->proposal || outs[i]->resolved)
continue;
if (!best || prop_blockheight(outs[i]) < prop_blockheight(best))
best = outs[i];

Loading…
Cancel
Save