Adding Bolt references around `commitment_signed` logic and conforming to them. This allows us to remove the `await_commitment_succcess` logic which was never elegant anyway, nice! While we’re there we remove a parameter from `handle_peer_commit_sig_batch` that shouldn’t have been there anyway. Changelog-Changed: Adding stricter conformance to Bolt spec for splice commitments.
38 lines
978 B
C
38 lines
978 B
C
#include "config.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->count = 0;
|
|
splice_state->locked_ready[LOCAL] = false;
|
|
splice_state->locked_ready[REMOTE] = false;
|
|
splice_state->inflights = NULL;
|
|
splice_state->remote_locked_txid = NULL;
|
|
|
|
return splice_state;
|
|
}
|
|
|
|
struct splicing *splicing_new(const tal_t *ctx)
|
|
{
|
|
struct splicing *splicing = tal(ctx, struct splicing);
|
|
|
|
splicing->opener_relative = 0;
|
|
splicing->accepter_relative = 0;
|
|
splicing->feerate_per_kw = 0;
|
|
splicing->force_feerate = false;
|
|
splicing->force_sign_first = false;
|
|
splicing->mode = false;
|
|
splicing->tx_add_input_count = 0;
|
|
splicing->tx_add_output_count = 0;
|
|
splicing->current_psbt = NULL;
|
|
splicing->received_tx_complete = false;
|
|
splicing->sent_tx_complete = false;
|
|
splicing->tx_sig_msg = NULL;
|
|
splicing->inws = NULL;
|
|
splicing->their_sig = NULL;
|
|
|
|
return splicing;
|
|
}
|