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 authored and rustyrussell committed Jul 28, 2022
1 parent 2b3ef37 commit d885407
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 @@ -3915,6 +3915,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 d885407

Please sign in to comment.