mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
pkt_open: use flag to indicate whether packet will offer anchor.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
93b5db89a8
commit
4d22b4e3eb
8
state.c
8
state.c
@ -109,11 +109,15 @@ enum state state(const enum state state, const struct state_data *sdata,
|
|||||||
*/
|
*/
|
||||||
case STATE_INIT_NOANCHOR:
|
case STATE_INIT_NOANCHOR:
|
||||||
assert(input == INPUT_NONE);
|
assert(input == INPUT_NONE);
|
||||||
set_effect(effect, send, pkt_open(effect, sdata));
|
set_effect(effect, send,
|
||||||
|
pkt_open(effect, sdata,
|
||||||
|
OPEN_CHANNEL__ANCHOR_OFFER__WONT_CREATE_ANCHOR));
|
||||||
return STATE_OPEN_WAIT_FOR_OPEN_NOANCHOR;
|
return STATE_OPEN_WAIT_FOR_OPEN_NOANCHOR;
|
||||||
case STATE_INIT_WITHANCHOR:
|
case STATE_INIT_WITHANCHOR:
|
||||||
assert(input == INPUT_NONE);
|
assert(input == INPUT_NONE);
|
||||||
set_effect(effect, send, pkt_open(effect, sdata));
|
set_effect(effect, send,
|
||||||
|
pkt_open(effect, sdata,
|
||||||
|
OPEN_CHANNEL__ANCHOR_OFFER__WILL_CREATE_ANCHOR));
|
||||||
return STATE_OPEN_WAIT_FOR_OPEN_WITHANCHOR;
|
return STATE_OPEN_WAIT_FOR_OPEN_WITHANCHOR;
|
||||||
case STATE_OPEN_WAIT_FOR_OPEN_NOANCHOR:
|
case STATE_OPEN_WAIT_FOR_OPEN_NOANCHOR:
|
||||||
if (input_is(input, PKT_OPEN)) {
|
if (input_is(input, PKT_OPEN)) {
|
||||||
|
3
state.h
3
state.h
@ -131,7 +131,8 @@ static inline bool input_is(enum state_input a, enum state_input b)
|
|||||||
struct signature;
|
struct signature;
|
||||||
|
|
||||||
/* Create various kinds of packets, allocated off @ctx */
|
/* Create various kinds of packets, allocated off @ctx */
|
||||||
Pkt *pkt_open(const tal_t *ctx, const struct state_data *sdata);
|
Pkt *pkt_open(const tal_t *ctx, const struct state_data *sdata,
|
||||||
|
OpenChannel__AnchorOffer anchor);
|
||||||
Pkt *pkt_anchor(const tal_t *ctx, const struct state_data *sdata);
|
Pkt *pkt_anchor(const tal_t *ctx, const struct state_data *sdata);
|
||||||
Pkt *pkt_open_commit_sig(const tal_t *ctx, const struct state_data *sdata);
|
Pkt *pkt_open_commit_sig(const tal_t *ctx, const struct state_data *sdata);
|
||||||
Pkt *pkt_open_complete(const tal_t *ctx, const struct state_data *sdata);
|
Pkt *pkt_open_complete(const tal_t *ctx, const struct state_data *sdata);
|
||||||
|
@ -564,7 +564,8 @@ static struct htlc *find_htlc_spend(const struct state_data *sdata,
|
|||||||
return (struct htlc *)h;
|
return (struct htlc *)h;
|
||||||
}
|
}
|
||||||
|
|
||||||
Pkt *pkt_open(const tal_t *ctx, const struct state_data *sdata)
|
Pkt *pkt_open(const tal_t *ctx, const struct state_data *sdata,
|
||||||
|
OpenChannel__AnchorOffer anchor)
|
||||||
{
|
{
|
||||||
return new_pkt(ctx, PKT_OPEN);
|
return new_pkt(ctx, PKT_OPEN);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user