mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
gossip: don't use assert around code with side effects.
The use of status_failed() requires a stubs update, which fails with unnamed parameters, so tweak the status.h header as well. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
0db821e2cf
commit
047a2ea043
@@ -54,7 +54,7 @@ void status_trace(const char *fmt, ...) PRINTF_FMT(1,2);
|
|||||||
/* vprintf-style */
|
/* vprintf-style */
|
||||||
void status_tracev(const char *fmt, va_list ap);
|
void status_tracev(const char *fmt, va_list ap);
|
||||||
/* Send a failure status code with printf-style msg, and exit. */
|
/* Send a failure status code with printf-style msg, and exit. */
|
||||||
void status_failed(enum status_fail, const char *fmt, ...) PRINTF_FMT(2,3) NORETURN;
|
void status_failed(enum status_fail code, const char *fmt, ...) PRINTF_FMT(2,3) NORETURN;
|
||||||
|
|
||||||
/* Helper for master failures: sends STATUS_FAIL_MASTER_IO.
|
/* Helper for master failures: sends STATUS_FAIL_MASTER_IO.
|
||||||
* msg NULL == read failure. */
|
* msg NULL == read failure. */
|
||||||
|
|||||||
@@ -583,8 +583,12 @@ bool handle_channel_announcement(
|
|||||||
serialized);
|
serialized);
|
||||||
|
|
||||||
if (forward) {
|
if (forward) {
|
||||||
assert(!queue_broadcast(rstate->broadcasts, WIRE_CHANNEL_ANNOUNCEMENT,
|
if (queue_broadcast(rstate->broadcasts,
|
||||||
(u8*)tag, serialized));
|
WIRE_CHANNEL_ANNOUNCEMENT,
|
||||||
|
(u8*)tag, serialized))
|
||||||
|
status_failed(STATUS_FAIL_INTERNAL_ERROR,
|
||||||
|
"Announcemnet %s was replaced?",
|
||||||
|
tal_hex(trc, serialized));
|
||||||
}
|
}
|
||||||
|
|
||||||
tal_free(tmpctx);
|
tal_free(tmpctx);
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ bool queue_broadcast(struct broadcast_state *bstate UNNEEDED,
|
|||||||
const u8 *tag UNNEEDED,
|
const u8 *tag UNNEEDED,
|
||||||
const u8 *payload UNNEEDED)
|
const u8 *payload UNNEEDED)
|
||||||
{ fprintf(stderr, "queue_broadcast called!\n"); abort(); }
|
{ fprintf(stderr, "queue_broadcast called!\n"); abort(); }
|
||||||
|
/* Generated stub for status_failed */
|
||||||
|
void status_failed(enum status_fail code UNNEEDED, const char *fmt UNNEEDED, ...)
|
||||||
|
{ fprintf(stderr, "status_failed called!\n"); abort(); }
|
||||||
/* Generated stub for towire_pubkey */
|
/* Generated stub for towire_pubkey */
|
||||||
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
||||||
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ bool queue_broadcast(struct broadcast_state *bstate UNNEEDED,
|
|||||||
const u8 *tag UNNEEDED,
|
const u8 *tag UNNEEDED,
|
||||||
const u8 *payload UNNEEDED)
|
const u8 *payload UNNEEDED)
|
||||||
{ fprintf(stderr, "queue_broadcast called!\n"); abort(); }
|
{ fprintf(stderr, "queue_broadcast called!\n"); abort(); }
|
||||||
|
/* Generated stub for status_failed */
|
||||||
|
void status_failed(enum status_fail code UNNEEDED, const char *fmt UNNEEDED, ...)
|
||||||
|
{ fprintf(stderr, "status_failed called!\n"); abort(); }
|
||||||
/* Generated stub for towire_pubkey */
|
/* Generated stub for towire_pubkey */
|
||||||
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
||||||
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ bool queue_broadcast(struct broadcast_state *bstate UNNEEDED,
|
|||||||
const u8 *tag UNNEEDED,
|
const u8 *tag UNNEEDED,
|
||||||
const u8 *payload UNNEEDED)
|
const u8 *payload UNNEEDED)
|
||||||
{ fprintf(stderr, "queue_broadcast called!\n"); abort(); }
|
{ fprintf(stderr, "queue_broadcast called!\n"); abort(); }
|
||||||
|
/* Generated stub for status_failed */
|
||||||
|
void status_failed(enum status_fail code UNNEEDED, const char *fmt UNNEEDED, ...)
|
||||||
|
{ fprintf(stderr, "status_failed called!\n"); abort(); }
|
||||||
/* Generated stub for towire_pubkey */
|
/* Generated stub for towire_pubkey */
|
||||||
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
void towire_pubkey(u8 **pptr UNNEEDED, const struct pubkey *pubkey UNNEEDED)
|
||||||
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
{ fprintf(stderr, "towire_pubkey called!\n"); abort(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user