Page MenuHomePhabricator

[backport#15408] Remove unused TransactionError constants
ClosedPublic

Authored by majcosta on May 8 2020, 20:05.

Details

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).

https://github.com/bitcoin/bitcoin/pull/15408/commits/fa9b60c842741dc92a33925fca5796ebaa4510bd


Depends on D6000

This is a backport of Core 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

majcosta requested review of this revision.May 8 2020, 20:05

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.May 8 2020, 21:51
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/node/transaction.h
28 ↗(On Diff #19847)

You can pass amount by value.

src/rpc/rawtransaction.cpp
982 ↗(On Diff #19847)

Yoda style for the win!

yodacond

Personally not a fan.

src/validation.cpp
393 ↗(On Diff #19847)

revert?

src/wallet/psbtwallet.h
27 ↗(On Diff #19847)

Fix formatting.

src/wallet/rpcwallet.cpp
4609 ↗(On Diff #19847)

yodacond

src/wallet/test/psbt_wallet_tests.cpp
96 ↗(On Diff #19847)

Even though it is not a condition, there is an hint of yoda style in there too.

This revision now requires changes to proceed.May 8 2020, 21:51

Yoda style, removed it is. Reverted validation.cpp change in favor of a separate diff, passed Amount by value plus formatting fixes

deadalnix requested changes to this revision.May 9 2020, 19:28
deadalnix added inline comments.
src/wallet/psbtwallet.h
27 ↗(On Diff #19862)

Formatting is still wrong.

This revision now requires changes to proceed.May 9 2020, 19:28
This revision is now accepted and ready to land.May 11 2020, 14:54