mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
lightningd, openingd: remove active code inside assert().
We don't compile with NDEBUG defined, but if we did, this code would vanish. I did a quick audit, inspired by @ZmnSCPxj. I actually hacked up something to compile with NDEBUG (many unused vars resulted, and of course unit tests are allowed to rely on assert()), and after this the testsuite still passes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -191,8 +191,9 @@ static void forward_event_notification_serialize(struct json_stream *stream,
|
||||
cur->channel_out = *scid_out;
|
||||
if (amount_out) {
|
||||
cur->msat_out = *amount_out;
|
||||
assert(amount_msat_sub(&cur->fee,
|
||||
in->msat, *amount_out));
|
||||
if (!amount_msat_sub(&cur->fee,
|
||||
in->msat, *amount_out))
|
||||
abort();
|
||||
} else {
|
||||
cur->msat_out = AMOUNT_MSAT(0);
|
||||
cur->fee = AMOUNT_MSAT(0);
|
||||
|
||||
Reference in New Issue
Block a user