Browse Source

Remove locktime-in-blocks option.

Needless complexity, AFAICT.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 10 years ago
parent
commit
8d31902785
  1. 40
      lightning.pb-c.c
  2. 17
      lightning.pb-c.h
  3. 5
      lightning.proto
  4. 1
      pkt.c

40
lightning.pb-c.c

@ -1383,7 +1383,7 @@ const ProtobufCMessageDescriptor anchor__descriptor =
(ProtobufCMessageInit) anchor__init, (ProtobufCMessageInit) anchor__init,
NULL,NULL,NULL /* reserved[123] */ NULL,NULL,NULL /* reserved[123] */
}; };
static const ProtobufCFieldDescriptor open_channel__field_descriptors[8] = static const ProtobufCFieldDescriptor open_channel__field_descriptors[7] =
{ {
{ {
"seed", "seed",
@ -1400,25 +1400,13 @@ static const ProtobufCFieldDescriptor open_channel__field_descriptors[8] =
{ {
"locktime_seconds", "locktime_seconds",
2, 2,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_UINT32, PROTOBUF_C_TYPE_UINT32,
offsetof(OpenChannel, locktime_case), 0, /* quantifier_offset */
offsetof(OpenChannel, locktime_seconds), offsetof(OpenChannel, locktime_seconds),
NULL, NULL,
NULL, NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */ 0, /* 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,NULL,NULL /* reserved1,reserved2, etc */ 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[] = { static const unsigned open_channel__field_indices_by_name[] = {
6, /* field[6] = anchor */ 5, /* field[5] = anchor */
5, /* field[5] = commitment_fee */ 4, /* field[4] = commitment_fee */
2, /* field[2] = locktime_blocks */
1, /* field[1] = locktime_seconds */ 1, /* field[1] = locktime_seconds */
3, /* field[3] = revocation_hash */ 2, /* field[2] = revocation_hash */
4, /* field[4] = script_to_me */ 3, /* field[3] = script_to_me */
0, /* field[0] = seed */ 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 }, { 1, 0 },
{ 0, 8 } { 4, 2 },
{ 0, 7 }
}; };
const ProtobufCMessageDescriptor open_channel__descriptor = const ProtobufCMessageDescriptor open_channel__descriptor =
{ {
@ -1505,10 +1493,10 @@ const ProtobufCMessageDescriptor open_channel__descriptor =
"OpenChannel", "OpenChannel",
"", "",
sizeof(OpenChannel), sizeof(OpenChannel),
8, 7,
open_channel__field_descriptors, open_channel__field_descriptors,
open_channel__field_indices_by_name, open_channel__field_indices_by_name,
1, open_channel__number_ranges, 2, open_channel__number_ranges,
(ProtobufCMessageInit) open_channel__init, (ProtobufCMessageInit) open_channel__init,
NULL,NULL,NULL /* reserved[123] */ NULL,NULL,NULL /* reserved[123] */
}; };

17
lightning.pb-c.h

@ -169,12 +169,6 @@ struct _Anchor
, 0,NULL, NULL, NULL, 0, 0, 0 } , 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. * Set channel params.
*/ */
@ -185,6 +179,10 @@ struct _OpenChannel
* Seed which sets order we create outputs for all transactions. * Seed which sets order we create outputs for all transactions.
*/ */
uint64_t seed; uint64_t seed;
/*
* Relative locktime for outputs going to us.
*/
uint32_t locktime_seconds;
/* /*
* Hash seed for revoking commitment transactions. * Hash seed for revoking commitment transactions.
*/ */
@ -205,15 +203,10 @@ struct _OpenChannel
* Maximum transaction version we support. * Maximum transaction version we support.
*/ */
uint32_t tx_version; uint32_t tx_version;
OpenChannel__LocktimeCase locktime_case;
union {
uint32_t locktime_seconds;
uint32_t locktime_blocks;
};
}; };
#define OPEN_CHANNEL__INIT \ #define OPEN_CHANNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&open_channel__descriptor) \ { 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 }
/* /*

5
lightning.proto

@ -67,10 +67,7 @@ message open_channel {
// Seed which sets order we create outputs for all transactions. // Seed which sets order we create outputs for all transactions.
required uint64 seed = 1; required uint64 seed = 1;
// Relative locktime for outputs going to us. // Relative locktime for outputs going to us.
oneof locktime { required uint32 locktime_seconds = 2;
uint32 locktime_seconds = 2;
uint32 locktime_blocks = 3;
}
// Hash seed for revoking commitment transactions. // Hash seed for revoking commitment transactions.
required sha256_hash revocation_hash = 4; required sha256_hash revocation_hash = 4;
// How to pay money to us from commit_tx. // How to pay money to us from commit_tx.

1
pkt.c

@ -78,7 +78,6 @@ struct pkt *openchannel_pkt(const tal_t *ctx,
o.script_to_me.data = (void *)script; o.script_to_me.data = (void *)script;
o.commitment_fee = commitment_fee; o.commitment_fee = commitment_fee;
o.anchor = anchor; o.anchor = anchor;
o.locktime_case = OPEN_CHANNEL__LOCKTIME_LOCKTIME_SECONDS;
o.locktime_seconds = rel_locktime_seconds; o.locktime_seconds = rel_locktime_seconds;
o.tx_version = BITCOIN_TX_VERSION; o.tx_version = BITCOIN_TX_VERSION;

Loading…
Cancel
Save