Browse Source

Remove varint typedef for bigsize

It's not part of the spec anymore

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
travis-experimental
Antoine Poinsot 4 years ago
committed by Rusty Russell
parent
commit
15adcc915f
  1. 3
      .gitignore
  2. 5
      common/bigsize.h
  3. 2
      devtools/mkquery.c
  4. 4
      devtools/print_wire.h
  5. 2
      gossipd/queries.c
  6. 2
      gossipd/test/run-extended-info.c
  7. 2
      plugins/keysend.c

3
.gitignore

@ -49,3 +49,6 @@ contrib/pyln-*/dist/
contrib/pyln-*/pyln_*.egg-info/
plugins/keysend
release/
devtools/route
devtools/topology

5
common/bigsize.h

@ -21,11 +21,6 @@ size_t bigsize_len(bigsize_t v);
/* Used for wire generation */
typedef bigsize_t bigsize;
/* FIXME: Some versions of spec using 'varint' for bigsize' */
typedef bigsize varint;
#define fromwire_varint fromwire_bigsize
#define towire_varint towire_bigsize
/* marshal/unmarshal functions */
void towire_bigsize(u8 **pptr, const bigsize_t val);
bigsize_t fromwire_bigsize(const u8 **cursor, size_t *max);

2
devtools/mkquery.c

@ -49,7 +49,7 @@ int main(int argc, char *argv[])
tlvs = NULL;
else if (argc == 6) {
tlvs = tlv_query_channel_range_tlvs_new(ctx);
tlvs->query_option = tal(tlvs, varint);
tlvs->query_option = tal(tlvs, bigsize_t);
*tlvs->query_option = strtol(argv[5], NULL, 0);
} else
usage();

4
devtools/print_wire.h

@ -14,10 +14,6 @@ struct tlv_print_record_type {
typedef u64 bigsize;
#define printwire_bigsize printwire_u64
/* FIXME: Some versions of spec using 'varint' for bigsize' */
typedef bigsize varint;
#define printwire_varint printwire_bigsize
void printwire_u8(const char *fieldname, const u8 *v);
void printwire_u16(const char *fieldname, const u16 *v);
void printwire_u32(const char *fieldname, const u32 *v);

2
gossipd/queries.c

@ -1040,7 +1040,7 @@ bool query_channel_range(struct daemon *daemon,
if (qflags) {
tlvs = tlv_query_channel_range_tlvs_new(tmpctx);
tlvs->query_option = tal(tlvs, varint);
tlvs->query_option = tal(tlvs, bigsize_t);
*tlvs->query_option = qflags;
} else
tlvs = NULL;

2
gossipd/test/run-extended-info.c

@ -341,7 +341,7 @@ static u8 *test_query_channel_range(const char *test_vector, const jsmntok_t *ob
json_for_each_arr(i, t, opt) {
assert(json_tok_streq(test_vector, t,
"WANT_TIMESTAMPS | WANT_CHECKSUMS"));
tlvs->query_option = tal(tlvs, varint);
tlvs->query_option = tal(tlvs, bigsize_t);
*tlvs->query_option =
QUERY_ADD_TIMESTAMPS | QUERY_ADD_CHECKSUMS;
}

2
plugins/keysend.c

@ -242,7 +242,7 @@ static struct command_result *htlc_accepted_call(struct command *cmd,
max = tal_bytelen(rawpayload);
payload = tlv_tlv_payload_new(cmd);
s = fromwire_varint(&rawpayload, &max);
s = fromwire_bigsize(&rawpayload, &max);
if (s != max) {
return htlc_accepted_continue(cmd, NULL);
}

Loading…
Cancel
Save