Skip to content

Conversation

gwillen
Copy link
Contributor

@gwillen gwillen commented Dec 17, 2018

  • Move most PSBT definitions into psbt.h.
  • Move most PSBT RPC utilities into psbt.{h,cpp}.
  • Move wallet-touching PSBT RPC utilities (FillPSBT) into
    wallet/psbtwallet.{h,cpp}.
  • Switch exceptions from JSONRPCError() to new PSBTException class.
  • Split DecodePSBT into DecodeBase64PSBT (old behavior) and DecodeRawPSBT.
  • Add one new version of DecodeBase64 utility in strencodings.h (and
    corresponding DecodeBase32 for completeness).
  • Factor BroadcastTransaction utility function out of sendrawtransaction RPC
    handler in rpc/rawtransaction.cpp

Note: For those keeping score at home wondering why refactor, this is in anticipation of (and developed in parallel with) a change to actually introduce GUI use of all this stuff, which is already under development and working-ish.


bool DecodeRawPSBT(PartiallySignedTransaction& psbt, const std::string& tx_data, std::string& error)
{
CDataStream ss_data(tx_data.begin(), tx_data.end(), SER_NETWORK, PROTOCOL_VERSION);
Copy link
Contributor Author

@gwillen gwillen Dec 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought I was very clever converting this from a std::vector<unsigned char> to a std::string, but the reality appears to be that Clang is happy with this line and g++ hates it, so I'm going to have to massage this back towards the original version a bit, in order to get it to build anywhere but macOS.

@gwillen
Copy link
Contributor Author

gwillen commented Dec 17, 2018

I cleverly made a small change that apparently g++ does not accept but Clang does, so I will have to fix that before it will build on Linux, oops. (I commented on the offending line in the diff.)

@gwillen gwillen force-pushed the feature-refactor-psbt-rpcs branch from 3c91a3d to 2fe27d6 Compare December 17, 2018 06:40
@gwillen
Copy link
Contributor Author

gwillen commented Dec 17, 2018

Hmm, something is also legitimately broken in the tests, will investigate tomorrow. :-\

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 17, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15253 (Net: Consistently log outgoing INV messages by Empact)
  • #15214 (tests: Check for expected return values when calling functions returning a success code by practicalswift)
  • #13932 (Additional utility RPCs for PSBT by achow101)
  • #13541 (wallet/rpc: sendrawtransaction maxfeerate by kallewoof)
  • #13266 ([moveonly] privatize SignatureExtractorChecker by Empact)
  • #12461 (scripted-diff: Rename key size consts to be relative to their class by Empact)
  • #9152 (Wallet/RPC: sweepprivkeys method to scan UTXO set and send to local wallet by luke-jr)

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.

@promag
Copy link
Contributor

promag commented Dec 17, 2018

Concept ACK.

for use in GUI code

Can you detail the GUI part?

which is already under development and working-ish.

Is it available?

@gwillen gwillen force-pushed the feature-refactor-psbt-rpcs branch from 2fe27d6 to 909bda5 Compare December 17, 2018 22:46
@gwillen
Copy link
Contributor Author

gwillen commented Dec 17, 2018

Can you detail the GUI part?

I'm adding an interface for offline and multisig signing in the GUI, using PSBT as the on-disk format for the intermediate files. See e.g. how Bitcoin Armory handles offline transactions, which I'm basically copying.

Is it available?

I pasted it into #bitcoin-core-dev awhile ago -- I will link it here in the comment thread once I'm sure the tip of my branch is still actually building.

@jb55
Copy link
Contributor

jb55 commented Dec 18, 2018 via email

@gwillen
Copy link
Contributor Author

gwillen commented Dec 18, 2018

The GUI work is WIP here: https://github.com/gwillen/bitcoin/tree/feature-offline-v1 . I made that branch at a known-working version, since I'm making significant changes to it right now.

It's not currently based on this PR, which I will have to rebase it onto later; this PR is an extraction of some refactoring that also appears in that PR, plus some other stuff that doesn't yet.

@gwillen
Copy link
Contributor Author

gwillen commented Dec 18, 2018

@jb55 Yeah, I can definitely split it out if people prefer. Will take a day or two to get to. I might ask slight forgiveness in some cases where a reasonable intermediate state between two combined changes never existed, and would be hard to recreate.

@Empact
Copy link
Contributor

Empact commented Dec 18, 2018

Would be helpful to split the commit up, for review now and for intelligibility when looking back in the future.

@achow101
Copy link
Member

Concept ACK. Agree with above, split this into multiple commits.

@promag
Copy link
Contributor

promag commented Dec 19, 2018

I definitely agree in splitting it.

@gwillen checked out the branch and looks promising.

@gwillen gwillen force-pushed the feature-refactor-psbt-rpcs branch 2 times, most recently from 71290c3 to e155e95 Compare January 9, 2019 11:10
@gwillen
Copy link
Contributor Author

gwillen commented Jan 9, 2019

Sorry for the delay. I have split the PR into more reasonable commits. The one that does the bulk of the code movement between files ("Move PSBT definitions and code to separate files") is now only movement (and adjusting headers / Makefile), and no other substantive changes.

The final result is exactly the same as before, except for a single stray blank line I had accidentally introduced in the previous version, which is removed.

Every intermediate step is intended to be sane and self-contained (and buildable), but I haven't actually verified (by compiler rather than by eye) that every intermediate step cleanly builds yet.

(EDIT: Wellll, I was pretty close. All intermediate states now build and pass tests.)

@gwillen gwillen force-pushed the feature-refactor-psbt-rpcs branch from e155e95 to dd45d3f Compare January 9, 2019 11:57
@jb55
Copy link
Contributor

jb55 commented Jan 9, 2019

This looks much better now! Thanks!

utACK dd45d3f

The refactorings look pretty good in general.

I did a quick skim of the code, I didn't see anything obviously wrong but I'm no expert on this part of the codebase.

Copy link
Member

@achow101 achow101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK dd45d3f

Some comments, nothing that block this IMO

@@ -188,9 +188,9 @@ std::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
return ret;
}

std::string DecodeBase64(const std::string& str)
std::string DecodeBase64(const std::string& str, bool* pfInvalid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: variable name should be snake_case. See doc/developer-notes.md for naming convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copied from surrounding context (it just wraps the c_str version of the same function, which has the same parameter named the same thing, and I'm propagating it outwards to the wrapper.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md:

When writing patches, favor the new style over attempting to mimic the surrounding style, except for move-only commits.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we're only calling DecodeBase64 in a handful of places, so you could also change the return type to bool and pass the output string as a reference param. Though it also makes sense to remain consistent with the existing (char*) methods.

Copy link
Contributor Author

@gwillen gwillen Jan 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix the argument name, but otherwise leave things alone unless you would strongly prefer the more invasive changes. (I am changing pfInvalid to pf_invalid everywhere in the surrounding context, because it will drive me completely nuts to make it inconsistent. Please don't make me do that.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let's not do too much in this PR.

src/psbt.h Outdated
/** An exception in PSBT processing that represents a problem with the input data --
when the input data is user-supplied, it is appropriate to catch() this and use
e.what() to retrieve a human-readable error message. */
class PSBTException: public std::runtime_error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in RPC errors with a code RPC_MISC_ERROR. I think it would be better if you could somehow make the error code more specific (the message still comes through).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd love any thoughts on how to accomplish this without gunking up non-RPC code too much when it calls this codepath. I don't really want this to depend on the RPC stuff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread 617247c#r246575002

One simple way this could be achieved is to add custom error handler to CRPCCommand which would translate this exception to the desired output.

One non intrusive way to add the error handler is to set it in

void RegisterWalletRPCCommands(CRPCTable &t)
{
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
t.appendCommand(commands[vcidx].name, &commands[vcidx]);

This way all desired commands would share the same error handling and then we can start removing duplicate error messages in the code by introducing more specific exceptions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly worried about the use of exceptions in code that use usable in more places than just RPC, as C++ can't guarantee that all possible exceptions are being dealt with at the right layer.

Would an enum with PSBT-related error codes, plus a enum to string conversion function (like in script/script_error) make sense?

@gwillen
Copy link
Contributor Author

gwillen commented Jan 9, 2019

FWIW I believe the travis failure is spurious -- it failed a single unrelated test, on a single platform, and the code hasn't changed since the last time it succeeded.

@gwillen gwillen force-pushed the feature-refactor-psbt-rpcs branch from dd45d3f to c062d74 Compare January 16, 2019 00:31
@gwillen
Copy link
Contributor Author

gwillen commented Jan 16, 2019

(Minor edit to remove a single unnecessary #include line that was bugging me, no significant change.)

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK c062d74 .Verified the move only commit, just adds necessary includes and updates the makefile with the new file. Some nits and other comments for your consideration.

bool invalid;
std::string tx_data = DecodeBase64(base64_tx, &invalid);
if (invalid) {
error = "invalid base64";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 801333b

Could add test for this new error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


bool DecodeRawPSBT(PartiallySignedTransaction& psbt, const std::string& tx_data, std::string& error)
{
CDataStream ss_data(tx_data.data(), tx_data.data() + tx_data.size(), SER_NETWORK, PROTOCOL_VERSION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 801333b

To avoid changing this line you could add a commit before with something along:

--- a/src/streams.h
+++ b/src/streams.h
@@ -236,17 +236,8 @@ public:
         Init(nTypeIn, nVersionIn);
     }

-    CDataStream(const vector_type& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())
-    {
-        Init(nTypeIn, nVersionIn);
-    }
-
-    CDataStream(const std::vector<char>& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())
-    {
-        Init(nTypeIn, nVersionIn);
-    }
-
-    CDataStream(const std::vector<unsigned char>& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())
+    template <typename T>
+    CDataStream(const T& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())
     {
         Init(nTypeIn, nVersionIn);
     }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe (does it not "prove too much")? Certainly I can imagine it might cause worse error messages in some cases. I assume it wasn't done that way for some reason originally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achow101 thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for fun, I went and checked -- this code is essentially unchanged since the repo was first imported to github in 2009. So the rationale is probably lost to history...

src/core_io.h Outdated
@@ -37,7 +37,8 @@ bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
*/
bool ParseHashStr(const std::string& strHex, uint256& result);
std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
NODISCARD bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error);
NODISCARD bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 801333b

nit, would be nice see brief comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: base64_psbt (see next comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

src/core_io.h Outdated
@@ -37,7 +37,8 @@ bool DecodeHexBlockHeader(CBlockHeader&, const std::string& hex_header);
*/
bool ParseHashStr(const std::string& strHex, uint256& result);
std::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);
NODISCARD bool DecodePSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error);
NODISCARD bool DecodeBase64PSBT(PartiallySignedTransaction& psbt, const std::string& base64_tx, std::string& error);
NODISCARD bool DecodeRawPSBT(PartiallySignedTransaction& psbt, const std::string& tx_data, std::string& error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 801333b

nit, s/tx_data/raw_tx?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both tx_data and raw_tx suggest a transaction hex. Something like raw_psbt is probably more clear, and consistent with the function name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -13,6 +13,9 @@ namespace interfaces {
class Chain;
} // namespace interfaces

/** Broadcast a transaction */
std::string BroadcastTransaction(CTransactionRef tx, bool allowhighfees = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 745c540

Shouldn't this be elsewhere if the goal is to use in the GUI?

I think this should return uint256.

nit, could document that the transaction id is returned.

nit, s/allowhighfees/allow_high_fees.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning uint256 seems more natural indeed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also need access to this function in #14912 from other wallet RPC methods. Not really an issue, because I can always include src/rpc/rawtransaction.h. But perhaps create a new src/wallet/transaction.cpp?

I might add BroadcastTransaction(PartiallySignedTransaction psbt, bool allowhighfees = false) in my own PR.

Copy link
Contributor Author

@gwillen gwillen Jan 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that this should be elsewhere, I will create src/wallet/transaction.cpp for it. (I was reluctant to be too original just to move a single function, but I prefer it that way also.) And agree regarding the return value, will change it.

I don't think there's too much additional value in taking a PartiallySignedTransaction, since finalization always results in a CTransaction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(agree with the latter, I ended up with a different approach too, the seperate file is useful enough)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but this now makes it more obvious that BroadcastTransaction has the same question as the PSBT functions as to how it shall signal an error, since right now it throws UniValues like the other RPC stuff.

RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL});

// parse hex string from parameter
CMutableTransaction mtx;
if (!DecodeHexTx(mtx, request.params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
CTransactionRef tx(MakeTransactionRef(std::move(mtx)));

bool allowhighfees = !request.params[1].isNull() && request.params[1].get_bool();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 745c540

nit, despite being valid I think it's more readable in the form:

bool allowhighfees = false;
if (!request.params[1].isNull()) allowhighfees = request.params[1].get_bool();

Because it is more clear the default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, done.

src/psbt.h Outdated
/** An exception in PSBT processing that represents a problem with the input data --
when the input data is user-supplied, it is appropriate to catch() this and use
e.what() to retrieve a human-readable error message. */
class PSBTException: public std::runtime_error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread 617247c#r246575002

One simple way this could be achieved is to add custom error handler to CRPCCommand which would translate this exception to the desired output.

One non intrusive way to add the error handler is to set it in

void RegisterWalletRPCCommands(CRPCTable &t)
{
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
t.appendCommand(commands[vcidx].name, &commands[vcidx]);

This way all desired commands would share the same error handling and then we can start removing duplicate error messages in the code by introducing more specific exceptions.

src/psbt.h Outdated
{
return !(a == b);
// Checks if they refer to the same underlying CTransaction
bool SameTx(const PartiallySignedTransaction& psbt) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 08ef528

If this is only used once and you now it's called from Merge then I suggest to inline it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, done.

@@ -391,20 +391,15 @@ struct PartiallySignedTransaction
std::map<std::vector<unsigned char>, std::vector<unsigned char>> unknown;

bool IsNull() const;
void Merge(const PartiallySignedTransaction& psbt);
NODISCARD bool Merge(const PartiallySignedTransaction& psbt);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 08ef528

Add comment explaining the return value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

src/psbt.cpp Outdated
}
}

PartiallySignedTransaction CombinePSBTs(std::vector<PartiallySignedTransaction> psbtxs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit c062d74

Make the argument a const reference.

nit, brace on new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@sipa sipa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big concept ACK

@@ -188,9 +188,9 @@ std::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
return ret;
}

std::string DecodeBase64(const std::string& str)
std::string DecodeBase64(const std::string& str, bool* pfInvalid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md:

When writing patches, favor the new style over attempting to mimic the surrounding style, except for move-only commits.

@@ -13,6 +13,9 @@ namespace interfaces {
class Chain;
} // namespace interfaces

/** Broadcast a transaction */
std::string BroadcastTransaction(CTransactionRef tx, bool allowhighfees = false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning uint256 seems more natural indeed.

src/psbt.h Outdated
/** An exception in PSBT processing that represents a problem with the input data --
when the input data is user-supplied, it is appropriate to catch() this and use
e.what() to retrieve a human-readable error message. */
class PSBTException: public std::runtime_error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly worried about the use of exceptions in code that use usable in more places than just RPC, as C++ can't guarantee that all possible exceptions are being dealt with at the right layer.

Would an enum with PSBT-related error codes, plus a enum to string conversion function (like in script/script_error) make sense?

kwvg added a commit to kwvg/dash that referenced this pull request May 20, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 2, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 4, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 9, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 9, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 15, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 16, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 1, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 5, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Aug 9, 2021
5tefan pushed a commit to 5tefan/dash that referenced this pull request Aug 12, 2021
5tefan pushed a commit to 5tefan/dash that referenced this pull request Aug 12, 2021
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Sep 7, 2021
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
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 24, 2021
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
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 24, 2021
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
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 24, 2021
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
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 27, 2021
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
dzutto pushed a commit to dzutto/dash that referenced this pull request Sep 30, 2021
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
kwvg pushed a commit to kwvg/dash that referenced this pull request Oct 12, 2021
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.