mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
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>
This commit is contained in:
parent
e746e9c202
commit
2945b25b57
1 changed files with 3 additions and 8 deletions
|
@ -514,12 +514,10 @@ static void proposal_meets_depth(struct tracked_output *out)
|
||||||
onchain_txtype_to_wallet_txtype(out->proposal->tx_type))));
|
onchain_txtype_to_wallet_txtype(out->proposal->tx_type))));
|
||||||
|
|
||||||
/* Don't wait for this if we're ignoring the tiny payment. */
|
/* 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);
|
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,
|
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->depth = 0;
|
||||||
out->resolved->tx_type = out->proposal->tx_type;
|
out->resolved->tx_type = out->proposal->tx_type;
|
||||||
|
|
||||||
/* Don't need proposal any more */
|
|
||||||
out->proposal = tal_free(out->proposal);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -760,7 +755,7 @@ static void billboard_update(struct tracked_output **outs)
|
||||||
|
|
||||||
/* Highest priority is to report on proposals we have */
|
/* Highest priority is to report on proposals we have */
|
||||||
for (size_t i = 0; i < tal_count(outs); i++) {
|
for (size_t i = 0; i < tal_count(outs); i++) {
|
||||||
if (!outs[i]->proposal)
|
if (!outs[i]->proposal || outs[i]->resolved)
|
||||||
continue;
|
continue;
|
||||||
if (!best || prop_blockheight(outs[i]) < prop_blockheight(best))
|
if (!best || prop_blockheight(outs[i]) < prop_blockheight(best))
|
||||||
best = outs[i];
|
best = outs[i];
|
||||||
|
|
Loading…
Add table
Reference in a new issue