mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
Remove varint typedef for bigsize
It's not part of the spec anymore Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
This commit is contained in:
parent
7db8680530
commit
15adcc915f
3
.gitignore
vendored
3
.gitignore
vendored
@ -49,3 +49,6 @@ contrib/pyln-*/dist/
|
|||||||
contrib/pyln-*/pyln_*.egg-info/
|
contrib/pyln-*/pyln_*.egg-info/
|
||||||
plugins/keysend
|
plugins/keysend
|
||||||
release/
|
release/
|
||||||
|
|
||||||
|
devtools/route
|
||||||
|
devtools/topology
|
||||||
|
@ -21,11 +21,6 @@ size_t bigsize_len(bigsize_t v);
|
|||||||
/* Used for wire generation */
|
/* Used for wire generation */
|
||||||
typedef bigsize_t bigsize;
|
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 */
|
/* marshal/unmarshal functions */
|
||||||
void towire_bigsize(u8 **pptr, const bigsize_t val);
|
void towire_bigsize(u8 **pptr, const bigsize_t val);
|
||||||
bigsize_t fromwire_bigsize(const u8 **cursor, size_t *max);
|
bigsize_t fromwire_bigsize(const u8 **cursor, size_t *max);
|
||||||
|
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
|
|||||||
tlvs = NULL;
|
tlvs = NULL;
|
||||||
else if (argc == 6) {
|
else if (argc == 6) {
|
||||||
tlvs = tlv_query_channel_range_tlvs_new(ctx);
|
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);
|
*tlvs->query_option = strtol(argv[5], NULL, 0);
|
||||||
} else
|
} else
|
||||||
usage();
|
usage();
|
||||||
|
@ -14,10 +14,6 @@ struct tlv_print_record_type {
|
|||||||
typedef u64 bigsize;
|
typedef u64 bigsize;
|
||||||
#define printwire_bigsize printwire_u64
|
#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_u8(const char *fieldname, const u8 *v);
|
||||||
void printwire_u16(const char *fieldname, const u16 *v);
|
void printwire_u16(const char *fieldname, const u16 *v);
|
||||||
void printwire_u32(const char *fieldname, const u32 *v);
|
void printwire_u32(const char *fieldname, const u32 *v);
|
||||||
|
@ -1040,7 +1040,7 @@ bool query_channel_range(struct daemon *daemon,
|
|||||||
|
|
||||||
if (qflags) {
|
if (qflags) {
|
||||||
tlvs = tlv_query_channel_range_tlvs_new(tmpctx);
|
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;
|
*tlvs->query_option = qflags;
|
||||||
} else
|
} else
|
||||||
tlvs = NULL;
|
tlvs = NULL;
|
||||||
|
@ -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) {
|
json_for_each_arr(i, t, opt) {
|
||||||
assert(json_tok_streq(test_vector, t,
|
assert(json_tok_streq(test_vector, t,
|
||||||
"WANT_TIMESTAMPS | WANT_CHECKSUMS"));
|
"WANT_TIMESTAMPS | WANT_CHECKSUMS"));
|
||||||
tlvs->query_option = tal(tlvs, varint);
|
tlvs->query_option = tal(tlvs, bigsize_t);
|
||||||
*tlvs->query_option =
|
*tlvs->query_option =
|
||||||
QUERY_ADD_TIMESTAMPS | QUERY_ADD_CHECKSUMS;
|
QUERY_ADD_TIMESTAMPS | QUERY_ADD_CHECKSUMS;
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@ static struct command_result *htlc_accepted_call(struct command *cmd,
|
|||||||
max = tal_bytelen(rawpayload);
|
max = tal_bytelen(rawpayload);
|
||||||
payload = tlv_tlv_payload_new(cmd);
|
payload = tlv_tlv_payload_new(cmd);
|
||||||
|
|
||||||
s = fromwire_varint(&rawpayload, &max);
|
s = fromwire_bigsize(&rawpayload, &max);
|
||||||
if (s != max) {
|
if (s != max) {
|
||||||
return htlc_accepted_continue(cmd, NULL);
|
return htlc_accepted_continue(cmd, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user