[rpc] fundrawtransaction feeRate: Use BTC/kB #8153
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) |
There was a problem hiding this comment.
it is probably satoshis. But not very clear, yes.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
typedef is not needed for structs and classes in C++.
There was a problem hiding this comment.
Fixed.
Also changed to union as suggested by @jonasschnelli
|
Nice! |
There was a problem hiding this comment.
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.
Right, I should probably just do s/union/struct/ to revert to struct.
There was a problem hiding this comment.
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.
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.
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.
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.
|
utACK fa7f4f5 |
No description provided.