mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
channel_states: fold all the ONCHAIND states into one.
The billboard is now far more useful to tell what's going on, and this gets us closer to a state == owner mapping. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
866ba00445
commit
cccdb53bec
@@ -48,21 +48,8 @@ static void onchaind_tell_fulfill(struct channel *channel)
|
||||
|
||||
static void handle_onchain_init_reply(struct channel *channel, const u8 *msg)
|
||||
{
|
||||
u8 state;
|
||||
|
||||
if (!fromwire_onchain_init_reply(msg, &state)) {
|
||||
channel_internal_error(channel, "Invalid onchain_init_reply");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!channel_state_on_chain(state)) {
|
||||
channel_internal_error(channel,
|
||||
"Invalid onchain_init_reply state %u (%s)",
|
||||
state, channel_state_str(state));
|
||||
return;
|
||||
}
|
||||
|
||||
channel_set_state(channel, FUNDING_SPEND_SEEN, state);
|
||||
/* FIXME: We may already be ONCHAIN state when we implement restart! */
|
||||
channel_set_state(channel, FUNDING_SPEND_SEEN, ONCHAIN);
|
||||
|
||||
/* Tell it about any preimages we know. */
|
||||
onchaind_tell_fulfill(channel);
|
||||
|
||||
Reference in New Issue
Block a user