From 15adcc915fc62eb87fa40dae5266fff9c0d55b6c Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 23 Sep 2020 00:49:53 +0200 Subject: [PATCH] Remove varint typedef for bigsize It's not part of the spec anymore Signed-off-by: Antoine Poinsot --- .gitignore | 3 +++ common/bigsize.h | 5 ----- devtools/mkquery.c | 2 +- devtools/print_wire.h | 4 ---- gossipd/queries.c | 2 +- gossipd/test/run-extended-info.c | 2 +- plugins/keysend.c | 2 +- 7 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index fca6083bf..487e2788e 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ contrib/pyln-*/dist/ contrib/pyln-*/pyln_*.egg-info/ plugins/keysend release/ + +devtools/route +devtools/topology diff --git a/common/bigsize.h b/common/bigsize.h index fe2d2bc78..fcbea0b4d 100644 --- a/common/bigsize.h +++ b/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); diff --git a/devtools/mkquery.c b/devtools/mkquery.c index 27ca543f2..348f76186 100644 --- a/devtools/mkquery.c +++ b/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(); diff --git a/devtools/print_wire.h b/devtools/print_wire.h index 58c013f5b..9fb969652 100644 --- a/devtools/print_wire.h +++ b/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); diff --git a/gossipd/queries.c b/gossipd/queries.c index 64e4ab00e..0da2cfeb5 100644 --- a/gossipd/queries.c +++ b/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; diff --git a/gossipd/test/run-extended-info.c b/gossipd/test/run-extended-info.c index d40b48c14..ce277c8c0 100644 --- a/gossipd/test/run-extended-info.c +++ b/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; } diff --git a/plugins/keysend.c b/plugins/keysend.c index 617788271..b46fb8af6 100644 --- a/plugins/keysend.c +++ b/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); }