mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
Remove locktime-in-blocks option.
Needless complexity, AFAICT. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
949c8c8d67
commit
8d31902785
4 changed files with 20 additions and 43 deletions
|
@ -1383,7 +1383,7 @@ const ProtobufCMessageDescriptor anchor__descriptor =
|
|||
(ProtobufCMessageInit) anchor__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor open_channel__field_descriptors[8] =
|
||||
static const ProtobufCFieldDescriptor open_channel__field_descriptors[7] =
|
||||
{
|
||||
{
|
||||
"seed",
|
||||
|
@ -1400,25 +1400,13 @@ static const ProtobufCFieldDescriptor open_channel__field_descriptors[8] =
|
|||
{
|
||||
"locktime_seconds",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_OPTIONAL,
|
||||
PROTOBUF_C_LABEL_REQUIRED,
|
||||
PROTOBUF_C_TYPE_UINT32,
|
||||
offsetof(OpenChannel, locktime_case),
|
||||
0, /* quantifier_offset */
|
||||
offsetof(OpenChannel, locktime_seconds),
|
||||
NULL,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"locktime_blocks",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_OPTIONAL,
|
||||
PROTOBUF_C_TYPE_UINT32,
|
||||
offsetof(OpenChannel, locktime_case),
|
||||
offsetof(OpenChannel, locktime_blocks),
|
||||
NULL,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
|
@ -1483,19 +1471,19 @@ static const ProtobufCFieldDescriptor open_channel__field_descriptors[8] =
|
|||
},
|
||||
};
|
||||
static const unsigned open_channel__field_indices_by_name[] = {
|
||||
6, /* field[6] = anchor */
|
||||
5, /* field[5] = commitment_fee */
|
||||
2, /* field[2] = locktime_blocks */
|
||||
5, /* field[5] = anchor */
|
||||
4, /* field[4] = commitment_fee */
|
||||
1, /* field[1] = locktime_seconds */
|
||||
3, /* field[3] = revocation_hash */
|
||||
4, /* field[4] = script_to_me */
|
||||
2, /* field[2] = revocation_hash */
|
||||
3, /* field[3] = script_to_me */
|
||||
0, /* field[0] = seed */
|
||||
7, /* field[7] = tx_version */
|
||||
6, /* field[6] = tx_version */
|
||||
};
|
||||
static const ProtobufCIntRange open_channel__number_ranges[1 + 1] =
|
||||
static const ProtobufCIntRange open_channel__number_ranges[2 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 8 }
|
||||
{ 4, 2 },
|
||||
{ 0, 7 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor open_channel__descriptor =
|
||||
{
|
||||
|
@ -1505,10 +1493,10 @@ const ProtobufCMessageDescriptor open_channel__descriptor =
|
|||
"OpenChannel",
|
||||
"",
|
||||
sizeof(OpenChannel),
|
||||
8,
|
||||
7,
|
||||
open_channel__field_descriptors,
|
||||
open_channel__field_indices_by_name,
|
||||
1, open_channel__number_ranges,
|
||||
2, open_channel__number_ranges,
|
||||
(ProtobufCMessageInit) open_channel__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
|
|
|
@ -169,12 +169,6 @@ struct _Anchor
|
|||
, 0,NULL, NULL, NULL, 0, 0, 0 }
|
||||
|
||||
|
||||
typedef enum {
|
||||
OPEN_CHANNEL__LOCKTIME__NOT_SET = 0,
|
||||
OPEN_CHANNEL__LOCKTIME_LOCKTIME_SECONDS = 2,
|
||||
OPEN_CHANNEL__LOCKTIME_LOCKTIME_BLOCKS = 3,
|
||||
} OpenChannel__LocktimeCase;
|
||||
|
||||
/*
|
||||
* Set channel params.
|
||||
*/
|
||||
|
@ -185,6 +179,10 @@ struct _OpenChannel
|
|||
* Seed which sets order we create outputs for all transactions.
|
||||
*/
|
||||
uint64_t seed;
|
||||
/*
|
||||
* Relative locktime for outputs going to us.
|
||||
*/
|
||||
uint32_t locktime_seconds;
|
||||
/*
|
||||
* Hash seed for revoking commitment transactions.
|
||||
*/
|
||||
|
@ -205,15 +203,10 @@ struct _OpenChannel
|
|||
* Maximum transaction version we support.
|
||||
*/
|
||||
uint32_t tx_version;
|
||||
OpenChannel__LocktimeCase locktime_case;
|
||||
union {
|
||||
uint32_t locktime_seconds;
|
||||
uint32_t locktime_blocks;
|
||||
};
|
||||
};
|
||||
#define OPEN_CHANNEL__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&open_channel__descriptor) \
|
||||
, 0, NULL, {0,NULL}, 0, NULL, 0, OPEN_CHANNEL__LOCKTIME__NOT_SET, {} }
|
||||
, 0, 0, NULL, {0,NULL}, 0, NULL, 0 }
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -67,10 +67,7 @@ message open_channel {
|
|||
// Seed which sets order we create outputs for all transactions.
|
||||
required uint64 seed = 1;
|
||||
// Relative locktime for outputs going to us.
|
||||
oneof locktime {
|
||||
uint32 locktime_seconds = 2;
|
||||
uint32 locktime_blocks = 3;
|
||||
}
|
||||
required uint32 locktime_seconds = 2;
|
||||
// Hash seed for revoking commitment transactions.
|
||||
required sha256_hash revocation_hash = 4;
|
||||
// How to pay money to us from commit_tx.
|
||||
|
|
1
pkt.c
1
pkt.c
|
@ -78,7 +78,6 @@ struct pkt *openchannel_pkt(const tal_t *ctx,
|
|||
o.script_to_me.data = (void *)script;
|
||||
o.commitment_fee = commitment_fee;
|
||||
o.anchor = anchor;
|
||||
o.locktime_case = OPEN_CHANNEL__LOCKTIME_LOCKTIME_SECONDS;
|
||||
o.locktime_seconds = rel_locktime_seconds;
|
||||
o.tx_version = BITCOIN_TX_VERSION;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue