-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify commit tx fee anchor cost #1721
Conversation
Since anchor outputs, we not only deduce the commit tx fee from the funder's main output but the cost of the anchors as well. We rename the function that does that for more clarity.
In some tests, we're only interested in the commit tx fee, not the cost of the anchors.
* If you are adding multiple fees together for example, you should always add them in MilliSatoshi and then round | ||
* down to Satoshi. | ||
*/ | ||
def toDeduceFromFunderOutputMsat(dustLimit: Satoshi, spec: CommitmentSpec, commitmentFormat: CommitmentFormat): MilliSatoshi = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would have gone with commitTxFeeMsat
and commitTxTotalCostMsat
def toDeduceFromFunderOutputMsat(dustLimit: Satoshi, spec: CommitmentSpec, commitmentFormat: CommitmentFormat): MilliSatoshi = { | |
def commitTxTotalCostMsat(dustLimit: Satoshi, spec: CommitmentSpec, commitmentFormat: CommitmentFormat): MilliSatoshi = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 856f427
Codecov Report
@@ Coverage Diff @@
## master #1721 +/- ##
==========================================
+ Coverage 86.30% 86.65% +0.35%
==========================================
Files 151 154 +3
Lines 11701 11988 +287
Branches 501 511 +10
==========================================
+ Hits 10098 10388 +290
+ Misses 1603 1600 -3
|
Since anchor outputs, we not only deduce the commit tx fee from the funder's main output but the cost of the anchors as well.
We rename the function that does that for more clarity as it came up in multiple reviews as something that was a bit confusing.
The change is split in two commits to make it easier to verify that there's no regression: