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:
Rusty Russell
2017-12-22 11:40:00 +10:30
committed by Christian Decker
parent 0db821e2cf
commit 047a2ea043
5 changed files with 16 additions and 3 deletions

View File

@@ -583,8 +583,12 @@ bool handle_channel_announcement(
serialized);
if (forward) {
assert(!queue_broadcast(rstate->broadcasts, WIRE_CHANNEL_ANNOUNCEMENT,
(u8*)tag, serialized));
if (queue_broadcast(rstate->broadcasts,
WIRE_CHANNEL_ANNOUNCEMENT,
(u8*)tag, serialized))
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Announcemnet %s was replaced?",
tal_hex(trc, serialized));
}
tal_free(tmpctx);