mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
devtools/decodemsg: fix printing of wireaddr.
printwire_ routines are supposed to print! And they're only needed inside devtools/. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -294,11 +294,6 @@ char *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a)
|
|||||||
}
|
}
|
||||||
REGISTER_TYPE_TO_STRING(wireaddr, fmt_wireaddr);
|
REGISTER_TYPE_TO_STRING(wireaddr, fmt_wireaddr);
|
||||||
|
|
||||||
char *printwire_wireaddr(const tal_t *ctx, const struct wireaddr *a)
|
|
||||||
{
|
|
||||||
return fmt_wireaddr(ctx, a);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Valid forms:
|
/* Valid forms:
|
||||||
*
|
*
|
||||||
* [anything]:<number>
|
* [anything]:<number>
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ bool parse_wireaddr(const char *arg, struct wireaddr *addr, u16 port,
|
|||||||
|
|
||||||
char *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a);
|
char *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a);
|
||||||
char *fmt_wireaddr_without_port(const tal_t *ctx, const struct wireaddr *a);
|
char *fmt_wireaddr_without_port(const tal_t *ctx, const struct wireaddr *a);
|
||||||
char *printwire_wireaddr(const tal_t *ctx, const struct wireaddr *a);
|
|
||||||
|
|
||||||
/* If no_dns is non-NULL, we will set it to true and return NULL if
|
/* If no_dns is non-NULL, we will set it to true and return NULL if
|
||||||
* we wanted to do a DNS lookup. */
|
* we wanted to do a DNS lookup. */
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ void printwire_u64(const char *fieldname, const u64 *v)
|
|||||||
printf("%"PRIu64"\n", *v);
|
printf("%"PRIu64"\n", *v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printwire_wireaddr(const char *fieldname, const struct wireaddr *wireaddr)
|
||||||
|
{
|
||||||
|
printf("%s\n", fmt_wireaddr(tmpctx, wireaddr));
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns false if we ran out of data. */
|
/* Returns false if we ran out of data. */
|
||||||
static bool print_hexstring(const u8 **cursor, size_t *plen, size_t len)
|
static bool print_hexstring(const u8 **cursor, size_t *plen, size_t len)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ struct tlv_print_record_type {
|
|||||||
|
|
||||||
typedef u64 bigsize;
|
typedef u64 bigsize;
|
||||||
#define printwire_bigsize printwire_u64
|
#define printwire_bigsize printwire_u64
|
||||||
|
struct wireaddr;
|
||||||
|
|
||||||
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);
|
||||||
@@ -24,6 +25,7 @@ void printwire_tlvs(const char *tlv_name, const u8 **cursor, size_t *plen,
|
|||||||
const struct tlv_print_record_type types[], size_t num_types);
|
const struct tlv_print_record_type types[], size_t num_types);
|
||||||
|
|
||||||
void printwire_bitcoin_blkid(const char *fieldname, const struct bitcoin_blkid *bitcoin_blkid);
|
void printwire_bitcoin_blkid(const char *fieldname, const struct bitcoin_blkid *bitcoin_blkid);
|
||||||
|
void printwire_wireaddr(const char *fieldname, const struct wireaddr *wireaddr);
|
||||||
void printwire_bitcoin_txid(const char *fieldname, const struct bitcoin_txid *bitcoin_txid);
|
void printwire_bitcoin_txid(const char *fieldname, const struct bitcoin_txid *bitcoin_txid);
|
||||||
void printwire_channel_id(const char *fieldname, const struct channel_id *channel_id);
|
void printwire_channel_id(const char *fieldname, const struct channel_id *channel_id);
|
||||||
void printwire_amount_sat(const char *fieldname, const struct amount_sat *sat);
|
void printwire_amount_sat(const char *fieldname, const struct amount_sat *sat);
|
||||||
|
|||||||
Reference in New Issue
Block a user