-
Notifications
You must be signed in to change notification settings - Fork 38.6k
[rpc] fundrawtransaction feeRate: Use BTC/kB #8153
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
Conversation
|
Should actually be BTC (or satoshis?) per byte, since we no longer do it per kB... |
|
All RPC arguments use BTC/kByte, no? |
|
It should be the same format than bitcoind spit out when one calls |
|
@jonasschnelli et al: Added a commit so I don't have to modify the univalue subtree. (Added a UniValueType wrapper instead) |
qa/rpc-tests/fundrawtransaction.py
Outdated
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.
nit s/sat/set
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.
it is probably satoshis. But not very clear, yes.
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.
Thanks, will fix the comment.
|
BTC/kB is fine, we use that for fee rates on the interface everywhere. The point of this change is to reduce the variety of different ways in which the same is expressed on the interface, not come up with something new. utACK faf82e8 |
|
I think @luke-jr was referring to kB no longer being the smallest unit. Currently we use Byte to be the smallest unit. |
src/rpc/rawtransaction.cpp
Outdated
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.
Looks muc hbetter in c++11 syntax
|
(Force pushed after fixing comment-nit) |
|
Not sure if I got this right, but why not just removing the |
|
We also want to suppress passing in unrecognized parameters. (Try removing it and see where the rpc tests fail. Hint: |
|
Ah. Right. Makes sense. |
src/rpc/server.h
Outdated
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.
typedef is not needed for structs and classes in C++.
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.
Fixed.
Also changed to union as suggested by @jonasschnelli
|
Nice! |
src/rpc/server.cpp
Outdated
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.
This is not valid. You can only access fields of a union that you know was the last one assigned to. Testing both typeAny and type certains violates that property at least once.
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.
Right, I should probably just do s/union/struct/ to revert to struct.
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 agree. It's very easy to violate the requirements of using an union accidentally, resulting in horrible hard to debug issues, I'd prefer not using them unless it's a place where the additional memory usage is critical. I don't think that's the case here.
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. Hope I got it right this time. 👍
Also introduce UniValueType UniValueType is a wrapper for UniValue::VType which allows setting a typeAny flag. This flag indicates the type does not matter. (Used by RPCTypeCheckObj)
|
|
||
| if (options.exists("feeRate")) | ||
| { | ||
| feeRate = CFeeRate(options["feeRate"].get_real()); |
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.
We slipped up with the review for #7967, shouldn't have allowed using get_real here. Good that this is being replaced.
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.
On the other hand, imagine if someone noticed it while reviewing #7967: The pull probably would have never made it into 0.13 before feature freeze, because adding the anytype is a non-trivial refactor and review is hard to do when there is substantial refactoring going on while adding new features.
Looking at it from this perspective, it makes sense to have two pulls to aid review.
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 agree
|
utACK fa7f4f5 |
No description provided.