diff --git a/lightning.pb-c.c b/lightning.pb-c.c index ea177a553..49a14b5ac 100644 --- a/lightning.pb-c.c +++ b/lightning.pb-c.c @@ -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] */ }; diff --git a/lightning.pb-c.h b/lightning.pb-c.h index b90b8bd92..376017545 100644 --- a/lightning.pb-c.h +++ b/lightning.pb-c.h @@ -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 } /* diff --git a/lightning.proto b/lightning.proto index 6b1c77102..c9a7851db 100644 --- a/lightning.proto +++ b/lightning.proto @@ -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. diff --git a/pkt.c b/pkt.c index 121018e76..278cfb907 100644 --- a/pkt.c +++ b/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;