Remove unused TransactionError constants#15408
Conversation
|
Concept ACK Nice cleanup! |
fadc1b2 to
fa1b275
Compare
fa1b275 to
fa9b60c
Compare
|
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. |
|
utACK The only thing I feel weird about here is the caller of BroadcastTransaction needing to know that there is a maxTxFee they are supposed to be using. Would it be possible to default that parameter to maxTxFee? (So that calls to BroadcastTransaction automatically obey the -maxtxfee command line flag if not overridden deliberately?) |
|
The goal in the future is to have it as a per-call default that can be overwritten by each individual rpc call. So the default should really live in the scope of the rpc method. |
fa9b60c Remove unused TransactionError constants (MarcoFalke) Pull request description: Fixup to #14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case. Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future). Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
Summary: Fixup to #14978, which introduced a bunch of unused enum values, such as UNKNOWN_ERROR, ERROR_COUNT and TRANSACTION_ERR_LAST. None of those have a meaning in the context of an enum class, where the compiler can infer if all cases have been covered in a switch-case. Also, move the global ::maxTxFee back to the rpc caller, so it can be set on a per call basis (in the future). bitcoin/bitcoin@fa9b60c --- Depends on D6000 This is a backport of Core [[bitcoin/bitcoin#15408 | PR15408]] plus: A few code cleanups in util/error.h/.cpp Corrected a comment in validation.cpp (regtest no longer supporting non-standard transactions re: D5764) Test Plan: cmake .. -GNinja -DENABLE_WERROR=ON ninja check-all cmake .. -GNinja -DENABLE_WERROR=ON -DBUILD_BITCOIN_WALLET=OFF ninja check-all Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6012
fa9b60c Remove unused TransactionError constants (MarcoFalke) Pull request description: Fixup to bitcoin#14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case. Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future). Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
…94_14969 Merge 0.18 PRs: bitcoin#14268, bitcoin#15408, bitcoin#14094, bitcoin#14935 and bitcoin#14969
Fixup to #14978, which introduced a bunch of unused enum values, such as
UNKNOWN_ERROR,ERROR_COUNTandTRANSACTION_ERR_LAST. None of those have a meaning in the context of anenum class, where the compiler can infer if all cases have been covered in a switch-case.Also, move the global
::maxTxFeeback to the rpc caller, so it can be set on a per call basis (in the future).