mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-23 06:55:13 +01:00
Update the lightningd <-> channeld interface with lots of new commands to needed to facilitate spicing. Implement the channeld splicing protocol leveraging the interactivetx protocol. Implement lightningd’s channel_control to support channeld in its splicing efforts. Changelog-Added: Added the features to enable splicing & resizing of active channels.
37 lines
965 B
C
37 lines
965 B
C
#include "config.h"
|
|
#include <ccan/tal/tal.h>
|
|
#include <channeld/splice.h>
|
|
|
|
struct splice_state *splice_state_new(const tal_t *ctx)
|
|
{
|
|
struct splice_state *splice_state = tal(ctx, struct splice_state);
|
|
|
|
splice_state->committed_count = 0;
|
|
splice_state->revoked_count = 0;
|
|
splice_state->count = 0;
|
|
splice_state->locked_ready[LOCAL] = false;
|
|
splice_state->locked_ready[REMOTE] = false;
|
|
splice_state->await_commitment_succcess = false;
|
|
splice_state->inflights = NULL;
|
|
|
|
return splice_state;
|
|
}
|
|
|
|
struct splice *splice_new(const tal_t *ctx)
|
|
{
|
|
struct splice *splice = tal(ctx, struct splice);
|
|
|
|
splice->opener_relative = 0;
|
|
splice->accepter_relative = 0;
|
|
splice->feerate_per_kw = 0;
|
|
splice->force_feerate = false;
|
|
splice->force_sign_first = false;
|
|
splice->mode = false;
|
|
splice->tx_add_input_count = 0;
|
|
splice->tx_add_output_count = 0;
|
|
splice->current_psbt = NULL;
|
|
splice->received_tx_complete = false;
|
|
splice->sent_tx_complete = false;
|
|
|
|
return splice;
|
|
}
|