forked from p2pderivatives/rust-dlc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate expected DLC funding fees correctly
Inspired by this patch[^1] in `master`. Since in the previous patch the `FUND_TX_BASE_WEIGHT` is passed explicit to the implementer of `get_utxos_for_amount`, we can exclude that from the target `amount` that we pass to `get_utxos_for_amount`. Besides the party's collateral and all the fees related to opening a _channel_, the only thing other that we need to take into account is the transaction fee for the CET or the refund transaction. The base weight can be split in half between the two parties, and each party then has to pay for their own (possible) output on the CET or refund transaction. When constructing the fund transaction itself, we were also forgetting to add the `8 + 1` bytes of each CET or refund transaction party outputs. [^1]: p2pderivatives@c4a0f88.
- Loading branch information
Showing
3 changed files
with
43 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters