mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
state: remove unnecessary set_errpkt() helper.
This was needed when idata->pkt wasn't a tal pointer, for testing, but now it always is anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
85f4a7cf14
commit
2c356fde55
4
state.c
4
state.c
@ -547,7 +547,7 @@ struct state_effect *state(const tal_t *ctx,
|
||||
return next_state(ctx, effect, STATE_CLOSE_WAIT_CLOSE);
|
||||
} else if (input_is(input, PKT_ERROR)) {
|
||||
add_effect(&effect, in_error,
|
||||
set_errpkt(ctx, idata->pkt));
|
||||
tal_steal(ctx, idata->pkt));
|
||||
goto start_unilateral_close_already_closing;
|
||||
} else if (input_is_pkt(input)) {
|
||||
/* We ignore all other packets while closing. */
|
||||
@ -845,7 +845,7 @@ unexpected_pkt:
|
||||
*/
|
||||
/* Don't reply to an error with an error. */
|
||||
if (input_is(input, PKT_ERROR)) {
|
||||
add_effect(&effect, in_error, set_errpkt(ctx, idata->pkt));
|
||||
add_effect(&effect, in_error, tal_steal(ctx, idata->pkt));
|
||||
goto start_unilateral_close;
|
||||
}
|
||||
err = unexpected_pkt(ctx, input);
|
||||
|
@ -482,12 +482,6 @@ static enum state_input input_by_name(const char *name)
|
||||
abort();
|
||||
}
|
||||
|
||||
/* We don't bother with lifetime issues */
|
||||
static Pkt *set_errpkt(const tal_t *ctx, const Pkt *pkt)
|
||||
{
|
||||
return (Pkt *)pkt;
|
||||
}
|
||||
|
||||
static Pkt *new_pkt(const tal_t *ctx, enum state_input i)
|
||||
{
|
||||
return (Pkt *)input_name(i);
|
||||
|
Loading…
Reference in New Issue
Block a user