Skip to content

Conversation

murchandamus
Copy link
Contributor

@murchandamus murchandamus commented Feb 9, 2022

This comment described how the constructor of CFeeRate was previously indirectly used to parse fee rate arguments from RPCs. The command line input was actually in sat/vB but due to the use of AmountFromValue() it got converted to BTC/vB which then got rectified in the constructor by creating a CFeeRate from that given value and COIN as the transaction size. Since this usage pattern was removed from the codebase some months ago, the comment is now obsolete.

@fanquake fanquake added the Docs label Feb 9, 2022
@maflcko maflcko changed the title Docs: Remove outdated confusing comment Docs: [policy] Remove outdated confusing comment Feb 10, 2022
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK bdc35cf

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #23633 (Make CFeeRate work with uint64_t sizes by kiminuo)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@murchandamus
Copy link
Contributor Author

Thanks, I've updated the PR to drop the square brackets and amend the commit message. I've also added the commas as suggested.

@murchandamus murchandamus force-pushed the 2022-02-improve-cfeerate-docs branch from fd2fb45 to fff3c83 Compare February 14, 2022 15:26
@jonatack
Copy link
Member

ACK

WDYT about the following, while here

diff

 private:
-    /** fee rate in sat/kvB (satoshis per 1000 virtualbytes) */
+    /** Fee rate in sat/kvB (satoshis per 1000 virtualbytes) */
     CAmount nSatoshisPerK;
 
 public:
-    /** Fee rate of 0 satoshis per kB */
+    /** Fee rate of 0 satoshis per kvB */
     CFeeRate() : nSatoshisPerK(0) { }
 
     /**
      * Return the fee in satoshis for the given size in bytes.
-     * If the calculated fee would have fractional satoshis, then the returned fee will always be rounded up to the nearest satoshi.
+     * If the calculated fee would have fractional satoshis, then the
+     * returned fee will always be rounded up to the nearest satoshi.
      */
     CAmount GetFee(uint32_t num_bytes) const;

This comment described how the constructor of CFeeRate was previously
indirectly used to parse fee rate arguments from RPCs. The command line
input was actually in sat/vB but due to the use of AmountFromValue() it
got converted to BTC/vB. In the constructor this could be rectified by
creating a CFeeRate from that given value (in BTC/vB) and COIN as the
transaction size, turning the input effectively to sat/vB. Since this
usage pattern was removed from the codebase some months ago, the comment
is now obsolete.

Also:
• Use vsize and vbyte instead of size and byte
@murchandamus murchandamus force-pushed the 2022-02-improve-cfeerate-docs branch from fff3c83 to e50a9be Compare February 14, 2022 21:02
@murchandamus
Copy link
Contributor Author

Sure, @jonatack, let's do it.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e50a9be

@michaelfolkson
Copy link

ACK e50a9be

I'm not sure about using the term vsize. As it isn't a measurement unit (e.g. kvB) and is just words I'd have thought virtual size would suffice. But it is nitty and happy to be ignored.

@maflcko maflcko merged commit e200919 into bitcoin:master Feb 22, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 22, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants