mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-26 20:30:59 +01:00
coin_mvt: rm unncessary if statement
We don't need to switch on this; if it's zero the below ops will be effectiely no-ops.
This commit is contained in:
parent
ea36c3a938
commit
b30328a91f
1 changed files with 17 additions and 20 deletions
|
@ -138,26 +138,23 @@ void channel_record_open(struct channel *channel)
|
||||||
blockheight = short_channel_id_blocknum(channel->scid);
|
blockheight = short_channel_id_blocknum(channel->scid);
|
||||||
|
|
||||||
/* If funds were pushed, add/sub them from the starting balance */
|
/* If funds were pushed, add/sub them from the starting balance */
|
||||||
if (is_pushed) {
|
if (channel->opener == LOCAL) {
|
||||||
if (channel->opener == LOCAL) {
|
if (!amount_msat_add(&start_balance,
|
||||||
if (!amount_msat_add(&start_balance,
|
channel->our_msat, channel->push))
|
||||||
channel->our_msat, channel->push))
|
fatal("Unable to add push_msat (%s) + our_msat (%s)",
|
||||||
fatal("Unable to add push_msat (%s) + our_msat (%s)",
|
type_to_string(tmpctx, struct amount_msat,
|
||||||
type_to_string(tmpctx, struct amount_msat,
|
&channel->push),
|
||||||
&channel->push),
|
type_to_string(tmpctx, struct amount_msat,
|
||||||
type_to_string(tmpctx, struct amount_msat,
|
&channel->our_msat));
|
||||||
&channel->our_msat));
|
} else {
|
||||||
} else {
|
if (!amount_msat_sub(&start_balance,
|
||||||
if (!amount_msat_sub(&start_balance,
|
channel->our_msat, channel->push))
|
||||||
channel->our_msat, channel->push))
|
fatal("Unable to sub our_msat (%s) - push (%s)",
|
||||||
fatal("Unable to sub our_msat (%s) - push (%s)",
|
type_to_string(tmpctx, struct amount_msat,
|
||||||
type_to_string(tmpctx, struct amount_msat,
|
&channel->our_msat),
|
||||||
&channel->our_msat),
|
type_to_string(tmpctx, struct amount_msat,
|
||||||
type_to_string(tmpctx, struct amount_msat,
|
&channel->push));
|
||||||
&channel->push));
|
}
|
||||||
}
|
|
||||||
} else
|
|
||||||
start_balance = channel->our_msat;
|
|
||||||
|
|
||||||
mvt = new_coin_channel_open(tmpctx,
|
mvt = new_coin_channel_open(tmpctx,
|
||||||
&channel->cid,
|
&channel->cid,
|
||||||
|
|
Loading…
Add table
Reference in a new issue