Skip to content

Commit

Permalink
bkpr, elements: elements tx have one extra output for fees
Browse files Browse the repository at this point in the history
if it's an elements chain, subtract one from the output count

we wait to calculate fees for a channel close until all the outputs are
accounted for, but elements chains create a separate output for the
amount of fees that are paid on a tx.

fixes crash in `test_penalty_rbf_burn`
  • Loading branch information
niftynei committed Mar 22, 2022
1 parent 43fdff9 commit 52340e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onchaind/onchaind.c
Original file line number Diff line number Diff line change
Expand Up @@ -3897,6 +3897,9 @@ int main(int argc, char *argv[])
&funding, tx_blockheight,
our_msat,
funding_sats,
is_elements(chainparams) ?
/* Minus 1, fee output */
tal_count(tx->outputs) - 1 :
tal_count(tx->outputs))));

status_debug("Remote per-commit point: %s",
Expand Down

0 comments on commit 52340e3

Please sign in to comment.