mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
common: Add scb_wire for serializing the static_chan_backup
This commit is contained in:
@@ -91,7 +91,7 @@ COMMON_SRC_NOGEN := \
|
|||||||
common/wire_error.c
|
common/wire_error.c
|
||||||
|
|
||||||
|
|
||||||
COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c
|
COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c common/scb_wiregen.c
|
||||||
|
|
||||||
COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
|
COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
|
||||||
common/closing_fee.h \
|
common/closing_fee.h \
|
||||||
@@ -105,13 +105,16 @@ COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
|
|||||||
common/overflows.h \
|
common/overflows.h \
|
||||||
common/tx_roles.h
|
common/tx_roles.h
|
||||||
|
|
||||||
COMMON_HEADERS_GEN := common/htlc_state_names_gen.h common/status_wiregen.h common/peer_status_wiregen.h
|
COMMON_HEADERS_GEN := common/htlc_state_names_gen.h common/status_wiregen.h common/peer_status_wiregen.h common/scb_wiregen.h
|
||||||
|
|
||||||
COMMON_HEADERS := $(COMMON_HEADERS_GEN) $(COMMON_HEADERS_NOGEN)
|
COMMON_HEADERS := $(COMMON_HEADERS_GEN) $(COMMON_HEADERS_NOGEN)
|
||||||
COMMON_SRC := $(COMMON_SRC_NOGEN) $(COMMON_SRC_GEN)
|
COMMON_SRC := $(COMMON_SRC_NOGEN) $(COMMON_SRC_GEN)
|
||||||
|
|
||||||
COMMON_OBJS := $(COMMON_SRC:.c=.o)
|
COMMON_OBJS := $(COMMON_SRC:.c=.o)
|
||||||
|
|
||||||
|
common/scb_wiregen.h_args := -s
|
||||||
|
common/scb_wiregen.c_args := -s
|
||||||
|
|
||||||
# Check that all h and c files are in the Makefile!
|
# Check that all h and c files are in the Makefile!
|
||||||
check-common-files:
|
check-common-files:
|
||||||
@$(call VERBOSE, "MISSING-SRC common", [ "$(filter-out $(COMMON_SRC), $(wildcard common/*.c))" = "" ])
|
@$(call VERBOSE, "MISSING-SRC common", [ "$(filter-out $(COMMON_SRC), $(wildcard common/*.c))" = "" ])
|
||||||
|
|||||||
21
common/scb_wire.csv
Normal file
21
common/scb_wire.csv
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include <common/node_id.h>
|
||||||
|
#include <common/channel_id.h>
|
||||||
|
#include <common/wireaddr.h>
|
||||||
|
#include <common/channel_type.h>
|
||||||
|
#include <common/amount.h>
|
||||||
|
#include <bitcoin/tx.h>
|
||||||
|
|
||||||
|
# scb_chan stores min. info required to sweep the peer's force close.
|
||||||
|
subtype,scb_chan
|
||||||
|
subtypedata,scb_chan,id,u64,
|
||||||
|
subtypedata,scb_chan,cid,channel_id,
|
||||||
|
subtypedata,scb_chan,node_id,node_id,
|
||||||
|
subtypedata,scb_chan,addr,wireaddr_internal,
|
||||||
|
subtypedata,scb_chan,funding,bitcoin_outpoint,
|
||||||
|
subtypedata,scb_chan,funding_sats,amount_sat,
|
||||||
|
subtypedata,scb_chan,type,channel_type,
|
||||||
|
msgtype,static_chan_backup,6135,
|
||||||
|
msgdata,static_chan_backup,version,u64,
|
||||||
|
msgdata,static_chan_backup,timestamp,u32,
|
||||||
|
msgdata,static_chan_backup,num,u16,
|
||||||
|
msgdata,static_chan_backup,channels,scb_chan,num
|
||||||
|
@@ -90,6 +90,7 @@ LIGHTNINGD_COMMON_OBJS := \
|
|||||||
common/features.o \
|
common/features.o \
|
||||||
common/fee_states.o \
|
common/fee_states.o \
|
||||||
common/peer_status_wiregen.o \
|
common/peer_status_wiregen.o \
|
||||||
|
common/scb_wiregen.o \
|
||||||
common/status_levels.o \
|
common/status_levels.o \
|
||||||
common/status_wiregen.o \
|
common/status_wiregen.o \
|
||||||
common/hash_u5.o \
|
common/hash_u5.o \
|
||||||
|
|||||||
@@ -694,6 +694,9 @@ u8 *towire_onchaind_dev_memleak(const tal_t *ctx UNNEEDED)
|
|||||||
/* Generated stub for towire_openingd_dev_memleak */
|
/* Generated stub for towire_openingd_dev_memleak */
|
||||||
u8 *towire_openingd_dev_memleak(const tal_t *ctx UNNEEDED)
|
u8 *towire_openingd_dev_memleak(const tal_t *ctx UNNEEDED)
|
||||||
{ fprintf(stderr, "towire_openingd_dev_memleak called!\n"); abort(); }
|
{ fprintf(stderr, "towire_openingd_dev_memleak called!\n"); abort(); }
|
||||||
|
/* Generated stub for towire_scb_chan */
|
||||||
|
void towire_scb_chan(u8 **p UNNEEDED, const struct scb_chan *scb_chan UNNEEDED)
|
||||||
|
{ fprintf(stderr, "towire_scb_chan called!\n"); abort(); }
|
||||||
/* Generated stub for towire_warningfmt */
|
/* Generated stub for towire_warningfmt */
|
||||||
u8 *towire_warningfmt(const tal_t *ctx UNNEEDED,
|
u8 *towire_warningfmt(const tal_t *ctx UNNEEDED,
|
||||||
const struct channel_id *channel UNNEEDED,
|
const struct channel_id *channel UNNEEDED,
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ class Type(FieldSet):
|
|||||||
'tx_parts',
|
'tx_parts',
|
||||||
'wally_psbt',
|
'wally_psbt',
|
||||||
'wally_tx',
|
'wally_tx',
|
||||||
'channel_type',
|
'scb_chan',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Some BOLT types are re-typed based on their field name
|
# Some BOLT types are re-typed based on their field name
|
||||||
|
|||||||
@@ -809,6 +809,9 @@ u8 *towire_required_channel_feature_missing(const tal_t *ctx UNNEEDED)
|
|||||||
/* Generated stub for towire_required_node_feature_missing */
|
/* Generated stub for towire_required_node_feature_missing */
|
||||||
u8 *towire_required_node_feature_missing(const tal_t *ctx UNNEEDED)
|
u8 *towire_required_node_feature_missing(const tal_t *ctx UNNEEDED)
|
||||||
{ fprintf(stderr, "towire_required_node_feature_missing called!\n"); abort(); }
|
{ fprintf(stderr, "towire_required_node_feature_missing called!\n"); abort(); }
|
||||||
|
/* Generated stub for towire_scb_chan */
|
||||||
|
void towire_scb_chan(u8 **p UNNEEDED, const struct scb_chan *scb_chan UNNEEDED)
|
||||||
|
{ fprintf(stderr, "towire_scb_chan called!\n"); abort(); }
|
||||||
/* Generated stub for towire_temporary_channel_failure */
|
/* Generated stub for towire_temporary_channel_failure */
|
||||||
u8 *towire_temporary_channel_failure(const tal_t *ctx UNNEEDED, const u8 *channel_update UNNEEDED)
|
u8 *towire_temporary_channel_failure(const tal_t *ctx UNNEEDED, const u8 *channel_update UNNEEDED)
|
||||||
{ fprintf(stderr, "towire_temporary_channel_failure called!\n"); abort(); }
|
{ fprintf(stderr, "towire_temporary_channel_failure called!\n"); abort(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user