Repository navigation
util: make ParseMoney return a std::optional<CAmount> - #22220
Conversation
ec7a4dc to
81ceb56
Compare
|
I was hoping to have both fixes in the same pull in different commits, since they require the reviewers to look up all call sites anyway:
|
|
Concept ACK |
|
Concept ACK Just out of curiosity, I was interested how this changes perf numbers for
(No guarrantees, I have tried this for the first time.) |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
|
Concept ACK, I like this kind of API much better than passing around separate booleans or error codes. |
|
Concept ACK Non-blocking nit: Personally I think |
| return InitError(AmountErrMsg("incrementalrelayfee", args.GetArg("-incrementalrelayfee", ""))); | ||
| incrementalRelayFee = CFeeRate(n); | ||
| const auto arg = args.GetArg("-incrementalrelayfee", ""); | ||
| if (auto inc_relay_fee = ParseMoney(arg)) { |
There was a problem hiding this comment.
TFW no rust-like unwrapping pattern matching if let Some(inc_relay_fee) = Parsemoney(arg) {
I hate the verbosity but I do agree in this case, the return type is not obvious. |
81ceb56 to
b3c0e67
Compare
I've added that now.
Changed to using I've also rebased and removed some unrelated arg refactoring. Will PR that separately. |
maflcko
left a comment
There was a problem hiding this comment.
approach ACK, didn't review the src/wallet/wallet.cpp part yet
b3c0e67 to
6aeed8d
Compare
Addressed suggestions so far. |
6aeed8d to
974abfb
Compare
There was a problem hiding this comment.
I don't think this improves clarity. Previously, ParseMoney() would only be called if -blockmintxfee is set. Now, we call ParseMoney() even if -blockmintxfee has not been set, and rely on the fact that it'll return a nullopt if we pass it an empty string.
There was a problem hiding this comment.
Reverted to something more like the previous code.
974abfb to
f7752ad
Compare
…utType> 32fa49a make ParseOutputType return a std::optional<OutputType> (fanquake) Pull request description: Similar to bitcoin#22220. Skipped using `auto` here for the same reasons outlined in that PR. ACKs for top commit: jnewbery: utACK 32fa49a jonatack: Code review ACK 32fa49a and debian clang 13 debug build is clean / unit tests locally are green MarcoFalke: review ACK 32fa49a 🍢 Tree-SHA512: 7752193117669b800889226185d49d164395697853828f8acb568f07651789bc5b2cddc45555957450353886e46b9a1e13c77a5e730a14c6ee621fabc8dc3d10
|
review ACK f7752ad 📄 Show signature and timestampSignature: Timestamp of file with hash |
Related discussion in #22193.