mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
tools/generate-wire.py: strip trailing whitespace on lines, fix bolt quotes.
There's a lot of it, and it means we can't `make check-source` on these files. Also bring bolt quotes up-to-date. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
3
channeld/channeld_wiregen.c
generated
3
channeld/channeld_wiregen.c
generated
@@ -1184,5 +1184,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str
|
|||||||
}
|
}
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:b706854b9a5a26d5176006150ca8a0d18def0fe79a255b55383a3b5beb6f86af
|
||||||
// SHA256STAMP:b336984ad884507c4624dec512a7ac93b4bfe92d543a1e077a1d2cf7d3c30fd3
|
|
||||||
|
|||||||
3
channeld/channeld_wiregen.h
generated
3
channeld/channeld_wiregen.h
generated
@@ -229,5 +229,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */
|
#endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:b706854b9a5a26d5176006150ca8a0d18def0fe79a255b55383a3b5beb6f86af
|
||||||
// SHA256STAMP:b336984ad884507c4624dec512a7ac93b4bfe92d543a1e077a1d2cf7d3c30fd3
|
|
||||||
|
|||||||
3
closingd/closingd_wiregen.c
generated
3
closingd/closingd_wiregen.c
generated
@@ -199,5 +199,4 @@ bool fromwire_closingd_complete(const void *p)
|
|||||||
return false;
|
return false;
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:b6e109cf1e06fb2421d1ee78a18015e2f4b8e0697509409357735aaba2a479a5
|
||||||
// SHA256STAMP:dbd3c58cd169d183d94e9b40e53243eb300e32d514f7891f332a117ff50f569c
|
|
||||||
|
|||||||
3
closingd/closingd_wiregen.h
generated
3
closingd/closingd_wiregen.h
generated
@@ -55,5 +55,4 @@ bool fromwire_closingd_complete(const void *p);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_CLOSINGD_CLOSINGD_WIREGEN_H */
|
#endif /* LIGHTNING_CLOSINGD_CLOSINGD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:b6e109cf1e06fb2421d1ee78a18015e2f4b8e0697509409357735aaba2a479a5
|
||||||
// SHA256STAMP:dbd3c58cd169d183d94e9b40e53243eb300e32d514f7891f332a117ff50f569c
|
|
||||||
|
|||||||
3
common/peer_status_wiregen.c
generated
3
common/peer_status_wiregen.c
generated
@@ -80,5 +80,4 @@ bool fromwire_status_peer_error(const tal_t *ctx, const void *p, struct channel_
|
|||||||
fromwire_u8_array(&cursor, &plen, *error_for_them, len);
|
fromwire_u8_array(&cursor, &plen, *error_for_them, len);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:f544c3823afd22d04793aed1f57fdaa57eecb207d1ad8186d0259c24c391b138
|
||||||
// SHA256STAMP:e956fdfdddc89d050229153e3db7a9539795b35b23d4c132f0f65eb0cc339d97
|
|
||||||
|
|||||||
3
common/peer_status_wiregen.h
generated
3
common/peer_status_wiregen.h
generated
@@ -34,5 +34,4 @@ bool fromwire_status_peer_error(const tal_t *ctx, const void *p, struct channel_
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_COMMON_PEER_STATUS_WIREGEN_H */
|
#endif /* LIGHTNING_COMMON_PEER_STATUS_WIREGEN_H */
|
||||||
|
// SHA256STAMP:f544c3823afd22d04793aed1f57fdaa57eecb207d1ad8186d0259c24c391b138
|
||||||
// SHA256STAMP:e956fdfdddc89d050229153e3db7a9539795b35b23d4c132f0f65eb0cc339d97
|
|
||||||
|
|||||||
3
common/status_wiregen.c
generated
3
common/status_wiregen.c
generated
@@ -191,5 +191,4 @@ bool fromwire_status_peer_billboard(const tal_t *ctx, const void *p, bool *perm,
|
|||||||
*happenings = fromwire_wirestring(ctx, &cursor, &plen);
|
*happenings = fromwire_wirestring(ctx, &cursor, &plen);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:473107ef4898aae5b290a9b994c0d17122ece1cdf07f50e34bc10ad0f84bcbd6
|
||||||
// SHA256STAMP:8459550d3539dee0f13d3c40aa017972987cd7901131fdaa1be05d393424636c
|
|
||||||
|
|||||||
3
common/status_wiregen.h
generated
3
common/status_wiregen.h
generated
@@ -53,5 +53,4 @@ bool fromwire_status_peer_billboard(const tal_t *ctx, const void *p, bool *perm,
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_COMMON_STATUS_WIREGEN_H */
|
#endif /* LIGHTNING_COMMON_STATUS_WIREGEN_H */
|
||||||
|
// SHA256STAMP:473107ef4898aae5b290a9b994c0d17122ece1cdf07f50e34bc10ad0f84bcbd6
|
||||||
// SHA256STAMP:8459550d3539dee0f13d3c40aa017972987cd7901131fdaa1be05d393424636c
|
|
||||||
|
|||||||
3
connectd/connectd_gossipd_wiregen.c
generated
3
connectd/connectd_gossipd_wiregen.c
generated
@@ -161,5 +161,4 @@ bool fromwire_gossipd_get_addrs_reply(const tal_t *ctx, const void *p, struct wi
|
|||||||
fromwire_wireaddr(&cursor, &plen, *addrs + i);
|
fromwire_wireaddr(&cursor, &plen, *addrs + i);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:a1efacc8ceb430e230ca7a5fb382307f3f86d95ac6cd1d67596294f98adc63f3
|
||||||
// SHA256STAMP:ff16f166eb5fe1a4389c503645deeea4b3e782cc3fb3fda7c87fab32c7f2ee05
|
|
||||||
|
|||||||
3
connectd/connectd_gossipd_wiregen.h
generated
3
connectd/connectd_gossipd_wiregen.h
generated
@@ -54,5 +54,4 @@ bool fromwire_gossipd_get_addrs_reply(const tal_t *ctx, const void *p, struct wi
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_CONNECTD_CONNECTD_GOSSIPD_WIREGEN_H */
|
#endif /* LIGHTNING_CONNECTD_CONNECTD_GOSSIPD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:a1efacc8ceb430e230ca7a5fb382307f3f86d95ac6cd1d67596294f98adc63f3
|
||||||
// SHA256STAMP:ff16f166eb5fe1a4389c503645deeea4b3e782cc3fb3fda7c87fab32c7f2ee05
|
|
||||||
|
|||||||
3
connectd/connectd_wiregen.c
generated
3
connectd/connectd_wiregen.c
generated
@@ -404,5 +404,4 @@ bool fromwire_connectd_dev_memleak_reply(const void *p, bool *leak)
|
|||||||
*leak = fromwire_bool(&cursor, &plen);
|
*leak = fromwire_bool(&cursor, &plen);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:ae6ae82d79526abc039896e90f677549a6acb73c0a2cd171f6658849025318b5
|
||||||
// SHA256STAMP:63529c4b1d95e8cb69c017829e3269e72c0d884545ae67b925f424b231c9633a
|
|
||||||
|
|||||||
3
connectd/connectd_wiregen.h
generated
3
connectd/connectd_wiregen.h
generated
@@ -103,5 +103,4 @@ bool fromwire_connectd_dev_memleak_reply(const void *p, bool *leak);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_CONNECTD_CONNECTD_WIREGEN_H */
|
#endif /* LIGHTNING_CONNECTD_CONNECTD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:ae6ae82d79526abc039896e90f677549a6acb73c0a2cd171f6658849025318b5
|
||||||
// SHA256STAMP:63529c4b1d95e8cb69c017829e3269e72c0d884545ae67b925f424b231c9633a
|
|
||||||
|
|||||||
3
gossipd/gossip_store_wiregen.c
generated
3
gossipd/gossip_store_wiregen.c
generated
@@ -117,5 +117,4 @@ bool fromwire_gossip_store_delete_chan(const void *p, struct short_channel_id *s
|
|||||||
fromwire_short_channel_id(&cursor, &plen, scid);
|
fromwire_short_channel_id(&cursor, &plen, scid);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:6c656ed77dab897dd0f8a9bb0bbdc9bfc5ad61f82d7ec6800d0987f766213e73
|
||||||
// SHA256STAMP:96e087792923799ac0e76d097bbf30972d627228742d69d9b1f90100cae8241a
|
|
||||||
|
|||||||
3
gossipd/gossip_store_wiregen.h
generated
3
gossipd/gossip_store_wiregen.h
generated
@@ -43,5 +43,4 @@ bool fromwire_gossip_store_delete_chan(const void *p, struct short_channel_id *s
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_GOSSIPD_GOSSIP_STORE_WIREGEN_H */
|
#endif /* LIGHTNING_GOSSIPD_GOSSIP_STORE_WIREGEN_H */
|
||||||
|
// SHA256STAMP:6c656ed77dab897dd0f8a9bb0bbdc9bfc5ad61f82d7ec6800d0987f766213e73
|
||||||
// SHA256STAMP:96e087792923799ac0e76d097bbf30972d627228742d69d9b1f90100cae8241a
|
|
||||||
|
|||||||
3
gossipd/gossipd_peerd_wiregen.c
generated
3
gossipd/gossipd_peerd_wiregen.c
generated
@@ -226,5 +226,4 @@ bool fromwire_gossipd_local_channel_announcement(const tal_t *ctx, const void *p
|
|||||||
fromwire_u8_array(&cursor, &plen, *cannount, len);
|
fromwire_u8_array(&cursor, &plen, *cannount, len);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:1ce1a60212ceeda5de7592f21328824690a16a1b6e59a4fc14e08fab9d355736
|
||||||
// SHA256STAMP:8d8786f111a7dea8a44e064e382adf00265494b06cdf4cef1c6466bd03878b73
|
|
||||||
|
|||||||
3
gossipd/gossipd_peerd_wiregen.h
generated
3
gossipd/gossipd_peerd_wiregen.h
generated
@@ -76,5 +76,4 @@ bool fromwire_gossipd_local_channel_announcement(const tal_t *ctx, const void *p
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_GOSSIPD_GOSSIPD_PEERD_WIREGEN_H */
|
#endif /* LIGHTNING_GOSSIPD_GOSSIPD_PEERD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:1ce1a60212ceeda5de7592f21328824690a16a1b6e59a4fc14e08fab9d355736
|
||||||
// SHA256STAMP:8d8786f111a7dea8a44e064e382adf00265494b06cdf4cef1c6466bd03878b73
|
|
||||||
|
|||||||
3
gossipd/gossipd_wiregen.c
generated
3
gossipd/gossipd_wiregen.c
generated
@@ -857,5 +857,4 @@ bool fromwire_gossipd_new_blockheight(const void *p, u32 *blockheight)
|
|||||||
*blockheight = fromwire_u32(&cursor, &plen);
|
*blockheight = fromwire_u32(&cursor, &plen);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:a494fd8a3f5ae31d113f387445744dd19490149be92d83f9bf61cc952457ad8f
|
||||||
// SHA256STAMP:9ac18b60ff39a11d7871d17a660aa9661a49d2585abe25d0ba0e048c32ac02eb
|
|
||||||
|
|||||||
3
gossipd/gossipd_wiregen.h
generated
3
gossipd/gossipd_wiregen.h
generated
@@ -199,5 +199,4 @@ bool fromwire_gossipd_new_blockheight(const void *p, u32 *blockheight);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_GOSSIPD_GOSSIPD_WIREGEN_H */
|
#endif /* LIGHTNING_GOSSIPD_GOSSIPD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:a494fd8a3f5ae31d113f387445744dd19490149be92d83f9bf61cc952457ad8f
|
||||||
// SHA256STAMP:9ac18b60ff39a11d7871d17a660aa9661a49d2585abe25d0ba0e048c32ac02eb
|
|
||||||
|
|||||||
3
hsmd/hsmd_wiregen.c
generated
3
hsmd/hsmd_wiregen.c
generated
@@ -1214,5 +1214,4 @@ bool fromwire_hsmd_get_output_scriptpubkey_reply(const tal_t *ctx, const void *p
|
|||||||
fromwire_u8_array(&cursor, &plen, *script, script_len);
|
fromwire_u8_array(&cursor, &plen, *script, script_len);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:6f67af9abcc4b8cd7fd2b0580341f72dd7ca323a4f1fa8fc02c97b83d63dec82
|
||||||
// SHA256STAMP:a5ae76a1418b72d95fbb559fe568596318040de4e3726f2317969b9d9eee7788
|
|
||||||
|
|||||||
3
hsmd/hsmd_wiregen.h
generated
3
hsmd/hsmd_wiregen.h
generated
@@ -271,5 +271,4 @@ bool fromwire_hsmd_get_output_scriptpubkey_reply(const tal_t *ctx, const void *p
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_HSMD_HSMD_WIREGEN_H */
|
#endif /* LIGHTNING_HSMD_HSMD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:6f67af9abcc4b8cd7fd2b0580341f72dd7ca323a4f1fa8fc02c97b83d63dec82
|
||||||
// SHA256STAMP:a5ae76a1418b72d95fbb559fe568596318040de4e3726f2317969b9d9eee7788
|
|
||||||
|
|||||||
3
onchaind/onchaind_wiregen.c
generated
3
onchaind/onchaind_wiregen.c
generated
@@ -635,5 +635,4 @@ bool fromwire_onchaind_notify_coin_mvt(const void *p, struct chain_coin_mvt *mvt
|
|||||||
fromwire_chain_coin_mvt(&cursor, &plen, mvt);
|
fromwire_chain_coin_mvt(&cursor, &plen, mvt);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:9f47e39e5ad9fb20dd7aa39f76a630b3ee41e430620975be8077f7f47e6febe6
|
||||||
// SHA256STAMP:e21aeee2bb2e0c56f77595f7083aaacecdaf2b88b6808b33a63de4adcce58de8
|
|
||||||
|
|||||||
3
onchaind/onchaind_wiregen.h
generated
3
onchaind/onchaind_wiregen.h
generated
@@ -161,5 +161,4 @@ bool fromwire_onchaind_notify_coin_mvt(const void *p, struct chain_coin_mvt *mvt
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_ONCHAIND_ONCHAIND_WIREGEN_H */
|
#endif /* LIGHTNING_ONCHAIND_ONCHAIND_WIREGEN_H */
|
||||||
|
// SHA256STAMP:9f47e39e5ad9fb20dd7aa39f76a630b3ee41e430620975be8077f7f47e6febe6
|
||||||
// SHA256STAMP:e21aeee2bb2e0c56f77595f7083aaacecdaf2b88b6808b33a63de4adcce58de8
|
|
||||||
|
|||||||
3
openingd/openingd_wiregen.c
generated
3
openingd/openingd_wiregen.c
generated
@@ -579,5 +579,4 @@ bool fromwire_openingd_dev_memleak_reply(const void *p, bool *leak)
|
|||||||
*leak = fromwire_bool(&cursor, &plen);
|
*leak = fromwire_bool(&cursor, &plen);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:8fda6ba9ec7bc264356849e91e6ad850ef2ee9c3dddf0dfdd7a2ac2cf4017abd
|
||||||
// SHA256STAMP:164910f4bbe7967d43674158574280364e83db53c4487f5f470ac0d2a929f90b
|
|
||||||
|
|||||||
3
openingd/openingd_wiregen.h
generated
3
openingd/openingd_wiregen.h
generated
@@ -121,5 +121,4 @@ bool fromwire_openingd_dev_memleak_reply(const void *p, bool *leak);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_OPENINGD_OPENINGD_WIREGEN_H */
|
#endif /* LIGHTNING_OPENINGD_OPENINGD_WIREGEN_H */
|
||||||
|
// SHA256STAMP:8fda6ba9ec7bc264356849e91e6ad850ef2ee9c3dddf0dfdd7a2ac2cf4017abd
|
||||||
// SHA256STAMP:164910f4bbe7967d43674158574280364e83db53c4487f5f470ac0d2a929f90b
|
|
||||||
|
|||||||
@@ -296,9 +296,7 @@ bool fromwire_${tlv.name}(const u8 **cursor, size_t *max, struct ${tlv.struct_na
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -396,7 +394,9 @@ bool ${tlv.name}_is_valid(const struct ${tlv.struct_name()} *record, size_t *err
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
|
|||||||
@@ -537,7 +537,8 @@ class Master(object):
|
|||||||
stuff['messages'] = list(self.messages.values()) + list(self.extension_msgs.values())
|
stuff['messages'] = list(self.messages.values()) + list(self.extension_msgs.values())
|
||||||
stuff['subtypes'] = subtypes
|
stuff['subtypes'] = subtypes
|
||||||
|
|
||||||
print(template.render(**stuff), file=output)
|
for line in template.render(**stuff).splitlines():
|
||||||
|
print(line.rstrip(), file=output)
|
||||||
|
|
||||||
|
|
||||||
def main(options, args=None, output=sys.stdout, lines=None):
|
def main(options, args=None, output=sys.stdout, lines=None):
|
||||||
|
|||||||
3
wire/common_wiregen.c
generated
3
wire/common_wiregen.c
generated
@@ -100,5 +100,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg)
|
|||||||
fromwire_u8_array(&cursor, &plen, *msg, msg_len);
|
fromwire_u8_array(&cursor, &plen, *msg, msg_len);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:1526dd638eeeb6b2a5170d7135a8bd80d91bcfa2ce8afa337d31209616e6cb9a
|
||||||
// SHA256STAMP:b7c32f920bcd5725670e679935629442e3866d3cba8e149d3269fec6835c1908
|
|
||||||
|
|||||||
3
wire/common_wiregen.h
generated
3
wire/common_wiregen.h
generated
@@ -41,5 +41,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_WIRE_COMMON_WIREGEN_H */
|
#endif /* LIGHTNING_WIRE_COMMON_WIREGEN_H */
|
||||||
|
// SHA256STAMP:1526dd638eeeb6b2a5170d7135a8bd80d91bcfa2ce8afa337d31209616e6cb9a
|
||||||
// SHA256STAMP:b7c32f920bcd5725670e679935629442e3866d3cba8e149d3269fec6835c1908
|
|
||||||
|
|||||||
113
wire/onion_printgen.c
generated
113
wire/onion_printgen.c
generated
@@ -105,72 +105,72 @@ void printonion_wire_message(const u8 *msg)
|
|||||||
printf("UNKNOWN: %s\\n", tal_hex(msg, msg));
|
printf("UNKNOWN: %s\\n", tal_hex(msg, msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void printwire_tlv_tlv_payload_amt_to_forward(const char *fieldname, const u8 **cursor, size_t *plen)
|
static void printwire_tlv_tlv_payload_amt_to_forward(const char *fieldname, const u8 **cursor, size_t *plen)
|
||||||
{
|
{
|
||||||
printf("(msg_name=%s)\n", "amt_to_forward");
|
printf("(msg_name=%s)\n", "amt_to_forward");
|
||||||
|
|
||||||
printf("amt_to_forward=");
|
printf("amt_to_forward=");
|
||||||
u64 amt_to_forward = fromwire_tu64(cursor, plen);
|
u64 amt_to_forward = fromwire_tu64(cursor, plen);
|
||||||
|
|
||||||
printwire_u64(tal_fmt(NULL, "%s.amt_to_forward", fieldname), &amt_to_forward);
|
printwire_u64(tal_fmt(NULL, "%s.amt_to_forward", fieldname), &amt_to_forward);
|
||||||
if (!*cursor) {
|
if (!*cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
static void printwire_tlv_tlv_payload_outgoing_cltv_value(const char *fieldname, const u8 **cursor, size_t *plen)
|
static void printwire_tlv_tlv_payload_outgoing_cltv_value(const char *fieldname, const u8 **cursor, size_t *plen)
|
||||||
{
|
{
|
||||||
printf("(msg_name=%s)\n", "outgoing_cltv_value");
|
printf("(msg_name=%s)\n", "outgoing_cltv_value");
|
||||||
|
|
||||||
printf("outgoing_cltv_value=");
|
printf("outgoing_cltv_value=");
|
||||||
u32 outgoing_cltv_value = fromwire_tu32(cursor, plen);
|
u32 outgoing_cltv_value = fromwire_tu32(cursor, plen);
|
||||||
|
|
||||||
printwire_u32(tal_fmt(NULL, "%s.outgoing_cltv_value", fieldname), &outgoing_cltv_value);
|
printwire_u32(tal_fmt(NULL, "%s.outgoing_cltv_value", fieldname), &outgoing_cltv_value);
|
||||||
if (!*cursor) {
|
if (!*cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
static void printwire_tlv_tlv_payload_short_channel_id(const char *fieldname, const u8 **cursor, size_t *plen)
|
static void printwire_tlv_tlv_payload_short_channel_id(const char *fieldname, const u8 **cursor, size_t *plen)
|
||||||
{
|
{
|
||||||
printf("(msg_name=%s)\n", "short_channel_id");
|
printf("(msg_name=%s)\n", "short_channel_id");
|
||||||
|
|
||||||
printf("short_channel_id=");
|
printf("short_channel_id=");
|
||||||
struct short_channel_id short_channel_id;
|
struct short_channel_id short_channel_id;
|
||||||
fromwire_short_channel_id(cursor, plen, &short_channel_id);
|
fromwire_short_channel_id(cursor, plen, &short_channel_id);
|
||||||
|
|
||||||
printwire_short_channel_id(tal_fmt(NULL, "%s.short_channel_id", fieldname), &short_channel_id);
|
printwire_short_channel_id(tal_fmt(NULL, "%s.short_channel_id", fieldname), &short_channel_id);
|
||||||
if (!*cursor) {
|
if (!*cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
static void printwire_tlv_tlv_payload_payment_data(const char *fieldname, const u8 **cursor, size_t *plen)
|
static void printwire_tlv_tlv_payload_payment_data(const char *fieldname, const u8 **cursor, size_t *plen)
|
||||||
{
|
{
|
||||||
printf("(msg_name=%s)\n", "payment_data");
|
printf("(msg_name=%s)\n", "payment_data");
|
||||||
|
|
||||||
printf("payment_secret=");
|
printf("payment_secret=");
|
||||||
struct secret payment_secret;
|
struct secret payment_secret;
|
||||||
fromwire_secret(cursor, plen, &payment_secret);
|
fromwire_secret(cursor, plen, &payment_secret);
|
||||||
|
|
||||||
printwire_secret(tal_fmt(NULL, "%s.payment_secret", fieldname), &payment_secret);
|
printwire_secret(tal_fmt(NULL, "%s.payment_secret", fieldname), &payment_secret);
|
||||||
if (!*cursor) {
|
if (!*cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("total_msat=");
|
printf("total_msat=");
|
||||||
u64 total_msat = fromwire_tu64(cursor, plen);
|
u64 total_msat = fromwire_tu64(cursor, plen);
|
||||||
|
|
||||||
printwire_u64(tal_fmt(NULL, "%s.total_msat", fieldname), &total_msat);
|
printwire_u64(tal_fmt(NULL, "%s.total_msat", fieldname), &total_msat);
|
||||||
if (!*cursor) {
|
if (!*cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct tlv_print_record_type print_tlvs_tlv_payload[] = {
|
static const struct tlv_print_record_type print_tlvs_tlv_payload[] = {
|
||||||
@@ -247,13 +247,13 @@ void printwire_invalid_onion_version(const char *fieldname, const u8 *cursor)
|
|||||||
printf("sha256_of_onion=");
|
printf("sha256_of_onion=");
|
||||||
struct sha256 sha256_of_onion;
|
struct sha256 sha256_of_onion;
|
||||||
fromwire_sha256(&cursor, &plen, &sha256_of_onion);
|
fromwire_sha256(&cursor, &plen, &sha256_of_onion);
|
||||||
|
|
||||||
printwire_sha256(tal_fmt(NULL, "%s.sha256_of_onion", fieldname), &sha256_of_onion);
|
printwire_sha256(tal_fmt(NULL, "%s.sha256_of_onion", fieldname), &sha256_of_onion);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -270,13 +270,13 @@ void printwire_invalid_onion_hmac(const char *fieldname, const u8 *cursor)
|
|||||||
printf("sha256_of_onion=");
|
printf("sha256_of_onion=");
|
||||||
struct sha256 sha256_of_onion;
|
struct sha256 sha256_of_onion;
|
||||||
fromwire_sha256(&cursor, &plen, &sha256_of_onion);
|
fromwire_sha256(&cursor, &plen, &sha256_of_onion);
|
||||||
|
|
||||||
printwire_sha256(tal_fmt(NULL, "%s.sha256_of_onion", fieldname), &sha256_of_onion);
|
printwire_sha256(tal_fmt(NULL, "%s.sha256_of_onion", fieldname), &sha256_of_onion);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -293,13 +293,13 @@ void printwire_invalid_onion_key(const char *fieldname, const u8 *cursor)
|
|||||||
printf("sha256_of_onion=");
|
printf("sha256_of_onion=");
|
||||||
struct sha256 sha256_of_onion;
|
struct sha256 sha256_of_onion;
|
||||||
fromwire_sha256(&cursor, &plen, &sha256_of_onion);
|
fromwire_sha256(&cursor, &plen, &sha256_of_onion);
|
||||||
|
|
||||||
printwire_sha256(tal_fmt(NULL, "%s.sha256_of_onion", fieldname), &sha256_of_onion);
|
printwire_sha256(tal_fmt(NULL, "%s.sha256_of_onion", fieldname), &sha256_of_onion);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -325,7 +325,7 @@ void printwire_temporary_channel_failure(const char *fieldname, const u8 *cursor
|
|||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -383,8 +383,8 @@ void printwire_amount_below_minimum(const char *fieldname, const u8 *cursor)
|
|||||||
|
|
||||||
printf("htlc_msat=");
|
printf("htlc_msat=");
|
||||||
struct amount_msat htlc_msat = fromwire_amount_msat(&cursor, &plen);
|
struct amount_msat htlc_msat = fromwire_amount_msat(&cursor, &plen);
|
||||||
|
|
||||||
printwire_amount_msat(tal_fmt(NULL, "%s.htlc_msat", fieldname), &htlc_msat);
|
printwire_amount_msat(tal_fmt(NULL, "%s.htlc_msat", fieldname), &htlc_msat);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
@@ -401,7 +401,7 @@ void printwire_amount_below_minimum(const char *fieldname, const u8 *cursor)
|
|||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -417,8 +417,8 @@ void printwire_fee_insufficient(const char *fieldname, const u8 *cursor)
|
|||||||
|
|
||||||
printf("htlc_msat=");
|
printf("htlc_msat=");
|
||||||
struct amount_msat htlc_msat = fromwire_amount_msat(&cursor, &plen);
|
struct amount_msat htlc_msat = fromwire_amount_msat(&cursor, &plen);
|
||||||
|
|
||||||
printwire_amount_msat(tal_fmt(NULL, "%s.htlc_msat", fieldname), &htlc_msat);
|
printwire_amount_msat(tal_fmt(NULL, "%s.htlc_msat", fieldname), &htlc_msat);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
@@ -435,7 +435,7 @@ void printwire_fee_insufficient(const char *fieldname, const u8 *cursor)
|
|||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -451,8 +451,8 @@ void printwire_incorrect_cltv_expiry(const char *fieldname, const u8 *cursor)
|
|||||||
|
|
||||||
printf("cltv_expiry=");
|
printf("cltv_expiry=");
|
||||||
u32 cltv_expiry = fromwire_u32(&cursor, &plen);
|
u32 cltv_expiry = fromwire_u32(&cursor, &plen);
|
||||||
|
|
||||||
printwire_u32(tal_fmt(NULL, "%s.cltv_expiry", fieldname), &cltv_expiry);
|
printwire_u32(tal_fmt(NULL, "%s.cltv_expiry", fieldname), &cltv_expiry);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
@@ -469,7 +469,7 @@ void printwire_incorrect_cltv_expiry(const char *fieldname, const u8 *cursor)
|
|||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -495,7 +495,7 @@ void printwire_expiry_too_soon(const char *fieldname, const u8 *cursor)
|
|||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -511,21 +511,21 @@ void printwire_incorrect_or_unknown_payment_details(const char *fieldname, const
|
|||||||
|
|
||||||
printf("htlc_msat=");
|
printf("htlc_msat=");
|
||||||
struct amount_msat htlc_msat = fromwire_amount_msat(&cursor, &plen);
|
struct amount_msat htlc_msat = fromwire_amount_msat(&cursor, &plen);
|
||||||
|
|
||||||
printwire_amount_msat(tal_fmt(NULL, "%s.htlc_msat", fieldname), &htlc_msat);
|
printwire_amount_msat(tal_fmt(NULL, "%s.htlc_msat", fieldname), &htlc_msat);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("height=");
|
printf("height=");
|
||||||
u32 height = fromwire_u32(&cursor, &plen);
|
u32 height = fromwire_u32(&cursor, &plen);
|
||||||
|
|
||||||
printwire_u32(tal_fmt(NULL, "%s.height", fieldname), &height);
|
printwire_u32(tal_fmt(NULL, "%s.height", fieldname), &height);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -541,13 +541,13 @@ void printwire_final_incorrect_cltv_expiry(const char *fieldname, const u8 *curs
|
|||||||
|
|
||||||
printf("cltv_expiry=");
|
printf("cltv_expiry=");
|
||||||
u32 cltv_expiry = fromwire_u32(&cursor, &plen);
|
u32 cltv_expiry = fromwire_u32(&cursor, &plen);
|
||||||
|
|
||||||
printwire_u32(tal_fmt(NULL, "%s.cltv_expiry", fieldname), &cltv_expiry);
|
printwire_u32(tal_fmt(NULL, "%s.cltv_expiry", fieldname), &cltv_expiry);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -563,13 +563,13 @@ void printwire_final_incorrect_htlc_amount(const char *fieldname, const u8 *curs
|
|||||||
|
|
||||||
printf("incoming_htlc_amt=");
|
printf("incoming_htlc_amt=");
|
||||||
struct amount_msat incoming_htlc_amt = fromwire_amount_msat(&cursor, &plen);
|
struct amount_msat incoming_htlc_amt = fromwire_amount_msat(&cursor, &plen);
|
||||||
|
|
||||||
printwire_amount_msat(tal_fmt(NULL, "%s.incoming_htlc_amt", fieldname), &incoming_htlc_amt);
|
printwire_amount_msat(tal_fmt(NULL, "%s.incoming_htlc_amt", fieldname), &incoming_htlc_amt);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -613,21 +613,21 @@ void printwire_invalid_onion_payload(const char *fieldname, const u8 *cursor)
|
|||||||
|
|
||||||
printf("type=");
|
printf("type=");
|
||||||
bigsize type = fromwire_bigsize(&cursor, &plen);
|
bigsize type = fromwire_bigsize(&cursor, &plen);
|
||||||
|
|
||||||
printwire_bigsize(tal_fmt(NULL, "%s.type", fieldname), &type);
|
printwire_bigsize(tal_fmt(NULL, "%s.type", fieldname), &type);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("offset=");
|
printf("offset=");
|
||||||
u16 offset = fromwire_u16(&cursor, &plen);
|
u16 offset = fromwire_u16(&cursor, &plen);
|
||||||
|
|
||||||
printwire_u16(tal_fmt(NULL, "%s.offset", fieldname), &offset);
|
printwire_u16(tal_fmt(NULL, "%s.offset", fieldname), &offset);
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
printf("**TRUNCATED**\n");
|
printf("**TRUNCATED**\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (plen != 0)
|
if (plen != 0)
|
||||||
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
printf("EXTRA: %s\n", tal_hexstr(NULL, cursor, plen));
|
||||||
@@ -653,5 +653,4 @@ void printonion_wire_tlv_message(const char *tlv_name, const u8 *msg) {
|
|||||||
printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_tlv_payload, ARRAY_SIZE(print_tlvs_tlv_payload));
|
printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_tlv_payload, ARRAY_SIZE(print_tlvs_tlv_payload));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:34ee8c689fc4081ab70cb70519583868d14057acdb69d1f3e242c4cfdbbbc39d
|
||||||
// SHA256STAMP:ceeead04b6dc0928c189be726bd2ea88561db5e91e69ba610ef76ed1ba9e552e
|
|
||||||
|
|||||||
3
wire/onion_printgen.h
generated
3
wire/onion_printgen.h
generated
@@ -57,5 +57,4 @@ void printwire_mpp_timeout(const char *fieldname, const u8 *cursor);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_WIRE_ONION_PRINTGEN_H */
|
#endif /* LIGHTNING_WIRE_ONION_PRINTGEN_H */
|
||||||
|
// SHA256STAMP:34ee8c689fc4081ab70cb70519583868d14057acdb69d1f3e242c4cfdbbbc39d
|
||||||
// SHA256STAMP:ceeead04b6dc0928c189be726bd2ea88561db5e91e69ba610ef76ed1ba9e552e
|
|
||||||
|
|||||||
17
wire/onion_wiregen.c
generated
17
wire/onion_wiregen.c
generated
@@ -112,7 +112,7 @@ static void fromwire_tlv_tlv_payload_amt_to_forward(const u8 **cursor, size_t *p
|
|||||||
struct tlv_tlv_payload *r = vrecord;
|
struct tlv_tlv_payload *r = vrecord;
|
||||||
|
|
||||||
r->amt_to_forward = tal(r, u64);
|
r->amt_to_forward = tal(r, u64);
|
||||||
|
|
||||||
*r->amt_to_forward = fromwire_tu64(cursor, plen);
|
*r->amt_to_forward = fromwire_tu64(cursor, plen);
|
||||||
}
|
}
|
||||||
/* TLV_PAYLOAD MSG: outgoing_cltv_value */
|
/* TLV_PAYLOAD MSG: outgoing_cltv_value */
|
||||||
@@ -135,7 +135,7 @@ static void fromwire_tlv_tlv_payload_outgoing_cltv_value(const u8 **cursor, size
|
|||||||
struct tlv_tlv_payload *r = vrecord;
|
struct tlv_tlv_payload *r = vrecord;
|
||||||
|
|
||||||
r->outgoing_cltv_value = tal(r, u32);
|
r->outgoing_cltv_value = tal(r, u32);
|
||||||
|
|
||||||
*r->outgoing_cltv_value = fromwire_tu32(cursor, plen);
|
*r->outgoing_cltv_value = fromwire_tu32(cursor, plen);
|
||||||
}
|
}
|
||||||
/* TLV_PAYLOAD MSG: short_channel_id */
|
/* TLV_PAYLOAD MSG: short_channel_id */
|
||||||
@@ -158,7 +158,7 @@ static void fromwire_tlv_tlv_payload_short_channel_id(const u8 **cursor, size_t
|
|||||||
struct tlv_tlv_payload *r = vrecord;
|
struct tlv_tlv_payload *r = vrecord;
|
||||||
|
|
||||||
r->short_channel_id = tal(r, struct short_channel_id);
|
r->short_channel_id = tal(r, struct short_channel_id);
|
||||||
|
|
||||||
fromwire_short_channel_id(cursor, plen, &*r->short_channel_id);
|
fromwire_short_channel_id(cursor, plen, &*r->short_channel_id);
|
||||||
}
|
}
|
||||||
/* TLV_PAYLOAD MSG: payment_data */
|
/* TLV_PAYLOAD MSG: payment_data */
|
||||||
@@ -233,9 +233,7 @@ bool fromwire_tlv_payload(const u8 **cursor, size_t *max, struct tlv_tlv_payload
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -333,7 +331,9 @@ bool tlv_payload_is_valid(const struct tlv_tlv_payload *record, size_t *err_inde
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -837,5 +837,4 @@ bool fromwire_mpp_timeout(const void *p)
|
|||||||
return false;
|
return false;
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:34ee8c689fc4081ab70cb70519583868d14057acdb69d1f3e242c4cfdbbbc39d
|
||||||
// SHA256STAMP:ceeead04b6dc0928c189be726bd2ea88561db5e91e69ba610ef76ed1ba9e552e
|
|
||||||
|
|||||||
3
wire/onion_wiregen.h
generated
3
wire/onion_wiregen.h
generated
@@ -207,5 +207,4 @@ bool fromwire_mpp_timeout(const void *p);
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_WIRE_ONION_WIREGEN_H */
|
#endif /* LIGHTNING_WIRE_ONION_WIREGEN_H */
|
||||||
|
// SHA256STAMP:34ee8c689fc4081ab70cb70519583868d14057acdb69d1f3e242c4cfdbbbc39d
|
||||||
// SHA256STAMP:ceeead04b6dc0928c189be726bd2ea88561db5e91e69ba610ef76ed1ba9e552e
|
|
||||||
|
|||||||
621
wire/peer_printgen.c
generated
621
wire/peer_printgen.c
generated
File diff suppressed because it is too large
Load Diff
3
wire/peer_printgen.h
generated
3
wire/peer_printgen.h
generated
@@ -70,5 +70,4 @@ void printwire_gossip_timestamp_filter(const char *fieldname, const u8 *cursor);
|
|||||||
void printwire_channel_update_checksums(const char *fieldname, const u8 **cursor, size_t *plen);
|
void printwire_channel_update_checksums(const char *fieldname, const u8 **cursor, size_t *plen);
|
||||||
void printwire_channel_update_timestamps(const char *fieldname, const u8 **cursor, size_t *plen);
|
void printwire_channel_update_timestamps(const char *fieldname, const u8 **cursor, size_t *plen);
|
||||||
#endif /* LIGHTNING_WIRE_PEER_PRINTGEN_H */
|
#endif /* LIGHTNING_WIRE_PEER_PRINTGEN_H */
|
||||||
|
// SHA256STAMP:521d619f25ebb8f49af991416c17ffbb6c9d2216cca98fe7be50824388d6bcac
|
||||||
// SHA256STAMP:387ba235bbb8248b61a18b8fc1b7842f5ad47bbbb53cc8cf2bb2b8f872ce5a0d
|
|
||||||
|
|||||||
79
wire/peer_wiregen.c
generated
79
wire/peer_wiregen.c
generated
@@ -203,9 +203,7 @@ bool fromwire_init_tlvs(const u8 **cursor, size_t *max, struct tlv_init_tlvs *re
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -303,7 +301,9 @@ bool init_tlvs_is_valid(const struct tlv_init_tlvs *record, size_t *err_index)
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -351,7 +351,7 @@ static void fromwire_tlv_n1_tlv1(const u8 **cursor, size_t *plen, void *vrecord)
|
|||||||
struct tlv_n1 *r = vrecord;
|
struct tlv_n1 *r = vrecord;
|
||||||
|
|
||||||
r->tlv1 = tal(r, u64);
|
r->tlv1 = tal(r, u64);
|
||||||
|
|
||||||
*r->tlv1 = fromwire_tu64(cursor, plen);
|
*r->tlv1 = fromwire_tu64(cursor, plen);
|
||||||
}
|
}
|
||||||
/* N1 MSG: tlv2 */
|
/* N1 MSG: tlv2 */
|
||||||
@@ -374,7 +374,7 @@ static void fromwire_tlv_n1_tlv2(const u8 **cursor, size_t *plen, void *vrecord)
|
|||||||
struct tlv_n1 *r = vrecord;
|
struct tlv_n1 *r = vrecord;
|
||||||
|
|
||||||
r->tlv2 = tal(r, struct short_channel_id);
|
r->tlv2 = tal(r, struct short_channel_id);
|
||||||
|
|
||||||
fromwire_short_channel_id(cursor, plen, &*r->tlv2);
|
fromwire_short_channel_id(cursor, plen, &*r->tlv2);
|
||||||
}
|
}
|
||||||
/* N1 MSG: tlv3 */
|
/* N1 MSG: tlv3 */
|
||||||
@@ -425,7 +425,7 @@ static void fromwire_tlv_n1_tlv4(const u8 **cursor, size_t *plen, void *vrecord)
|
|||||||
struct tlv_n1 *r = vrecord;
|
struct tlv_n1 *r = vrecord;
|
||||||
|
|
||||||
r->tlv4 = tal(r, u16);
|
r->tlv4 = tal(r, u16);
|
||||||
|
|
||||||
*r->tlv4 = fromwire_u16(cursor, plen);
|
*r->tlv4 = fromwire_u16(cursor, plen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,9 +475,7 @@ bool fromwire_n1(const u8 **cursor, size_t *max, struct tlv_n1 *record)
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -575,7 +573,9 @@ bool n1_is_valid(const struct tlv_n1 *record, size_t *err_index)
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -623,7 +623,7 @@ static void fromwire_tlv_n2_tlv1(const u8 **cursor, size_t *plen, void *vrecord)
|
|||||||
struct tlv_n2 *r = vrecord;
|
struct tlv_n2 *r = vrecord;
|
||||||
|
|
||||||
r->tlv1 = tal(r, u64);
|
r->tlv1 = tal(r, u64);
|
||||||
|
|
||||||
*r->tlv1 = fromwire_tu64(cursor, plen);
|
*r->tlv1 = fromwire_tu64(cursor, plen);
|
||||||
}
|
}
|
||||||
/* N2 MSG: tlv2 */
|
/* N2 MSG: tlv2 */
|
||||||
@@ -646,7 +646,7 @@ static void fromwire_tlv_n2_tlv2(const u8 **cursor, size_t *plen, void *vrecord)
|
|||||||
struct tlv_n2 *r = vrecord;
|
struct tlv_n2 *r = vrecord;
|
||||||
|
|
||||||
r->tlv2 = tal(r, u32);
|
r->tlv2 = tal(r, u32);
|
||||||
|
|
||||||
*r->tlv2 = fromwire_tu32(cursor, plen);
|
*r->tlv2 = fromwire_tu32(cursor, plen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -694,9 +694,7 @@ bool fromwire_n2(const u8 **cursor, size_t *max, struct tlv_n2 *record)
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -794,7 +792,9 @@ bool n2_is_valid(const struct tlv_n2 *record, size_t *err_index)
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -888,9 +888,7 @@ bool fromwire_open_channel_tlvs(const u8 **cursor, size_t *max, struct tlv_open_
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -988,7 +986,9 @@ bool open_channel_tlvs_is_valid(const struct tlv_open_channel_tlvs *record, size
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -1082,9 +1082,7 @@ bool fromwire_accept_channel_tlvs(const u8 **cursor, size_t *max, struct tlv_acc
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -1182,7 +1180,9 @@ bool accept_channel_tlvs_is_valid(const struct tlv_accept_channel_tlvs *record,
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -1280,9 +1280,7 @@ bool fromwire_query_short_channel_ids_tlvs(const u8 **cursor, size_t *max, struc
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -1380,7 +1378,9 @@ bool query_short_channel_ids_tlvs_is_valid(const struct tlv_query_short_channel_
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -1428,7 +1428,7 @@ static void fromwire_tlv_query_channel_range_tlvs_query_option(const u8 **cursor
|
|||||||
struct tlv_query_channel_range_tlvs *r = vrecord;
|
struct tlv_query_channel_range_tlvs *r = vrecord;
|
||||||
|
|
||||||
r->query_option = tal(r, bigsize);
|
r->query_option = tal(r, bigsize);
|
||||||
|
|
||||||
*r->query_option = fromwire_bigsize(cursor, plen);
|
*r->query_option = fromwire_bigsize(cursor, plen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1475,9 +1475,7 @@ bool fromwire_query_channel_range_tlvs(const u8 **cursor, size_t *max, struct tl
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -1575,7 +1573,9 @@ bool query_channel_range_tlvs_is_valid(const struct tlv_query_channel_range_tlvs
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -1701,9 +1701,7 @@ bool fromwire_reply_channel_range_tlvs(const u8 **cursor, size_t *max, struct tl
|
|||||||
|
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
*
|
*
|
||||||
* A `varint` is a variable-length, unsigned integer encoding
|
* The `type` is encoded using the BigSize format.
|
||||||
* using the [BigSize](#appendix-a-bigsize-test-vectors)
|
|
||||||
* format
|
|
||||||
*/
|
*/
|
||||||
field.numtype = fromwire_bigsize(cursor, max);
|
field.numtype = fromwire_bigsize(cursor, max);
|
||||||
|
|
||||||
@@ -1801,7 +1799,9 @@ bool reply_channel_range_tlvs_is_valid(const struct tlv_reply_channel_range_tlvs
|
|||||||
return false;
|
return false;
|
||||||
} else if (!first && f->numtype <= prev_type) {
|
} else if (!first && f->numtype <= prev_type) {
|
||||||
/* BOLT #1:
|
/* BOLT #1:
|
||||||
* - if decoded `type`s are not monotonically-increasing:
|
* - if decoded `type`s are not strictly-increasing
|
||||||
|
* (including situations when two or more occurrences
|
||||||
|
* of the same `type` are met):
|
||||||
* - MUST fail to parse the `tlv_stream`.
|
* - MUST fail to parse the `tlv_stream`.
|
||||||
*/
|
*/
|
||||||
if (f->numtype == prev_type)
|
if (f->numtype == prev_type)
|
||||||
@@ -2750,5 +2750,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec
|
|||||||
*htlc_maximum_msat = fromwire_amount_msat(&cursor, &plen);
|
*htlc_maximum_msat = fromwire_amount_msat(&cursor, &plen);
|
||||||
return cursor != NULL;
|
return cursor != NULL;
|
||||||
}
|
}
|
||||||
|
// SHA256STAMP:521d619f25ebb8f49af991416c17ffbb6c9d2216cca98fe7be50824388d6bcac
|
||||||
// SHA256STAMP:387ba235bbb8248b61a18b8fc1b7842f5ad47bbbb53cc8cf2bb2b8f872ce5a0d
|
|
||||||
|
|||||||
3
wire/peer_wiregen.h
generated
3
wire/peer_wiregen.h
generated
@@ -595,5 +595,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec
|
|||||||
|
|
||||||
|
|
||||||
#endif /* LIGHTNING_WIRE_PEER_WIREGEN_H */
|
#endif /* LIGHTNING_WIRE_PEER_WIREGEN_H */
|
||||||
|
// SHA256STAMP:521d619f25ebb8f49af991416c17ffbb6c9d2216cca98fe7be50824388d6bcac
|
||||||
// SHA256STAMP:387ba235bbb8248b61a18b8fc1b7842f5ad47bbbb53cc8cf2bb2b8f872ce5a0d
|
|
||||||
|
|||||||
Reference in New Issue
Block a user