diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-01 15:33:52 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-01 15:34:05 -0500 |
commit | 54a7ef612a3b69984d521432f8a694a682c76090 (patch) | |
tree | 13004adb153060fe957b54a0f18f3e03c2228a00 /src/node | |
parent | 715dbbe9e8b64fd4b556a0b0720b44d68c3b5e32 (diff) | |
parent | 10efc0487c442bccb0e4a9ac29452af1592a3cf2 (diff) | |
download | bitcoin-54a7ef612a3b69984d521432f8a694a682c76090.tar.xz |
Merge #17399: validation: Templatize ValidationState instead of subclassing
10efc0487c442bccb0e4a9ac29452af1592a3cf2 Templatize ValidationState instead of subclassing (Jeffrey Czyz)
10e85d4adc9b7dbbda63e00195e0a962f51e4d2c Remove ValidationState's constructor (Jeffrey Czyz)
0aed17ef2892478c28cd660e53223c6dd1dc0187 Refactor FormatStateMessage into ValidationState (Jeffrey Czyz)
Pull request description:
This removes boilerplate code in the subclasses which otherwise only
differ by the result type.
The subclassing was introduced in a27a295.
ACKs for top commit:
MarcoFalke:
ACK 10efc0487c442bccb0e4a9ac29452af1592a3cf2 🐱
ajtowns:
ACK 10efc0487c442bccb0e4a9ac29452af1592a3cf2 -- looks good to me
jonatack:
ACK 10efc048 code review, build/tests green, nice cleanup
Tree-SHA512: 765dd52dde7d49b9a5c6d99d97c96f4492673e2aed0b0604faa88db0308fa4500a26bf755cca0b896be283874096c215932e1110a2d01dc012cd36a5fce58a42
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/transaction.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index 1bb9b88d00..201406ce3b 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -7,7 +7,6 @@ #include <net.h> #include <net_processing.h> #include <node/context.h> -#include <util/validation.h> #include <validation.h> #include <validationinterface.h> #include <node/transaction.h> @@ -41,7 +40,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t TxValidationState state; if (!AcceptToMemoryPool(*node.mempool, state, std::move(tx), nullptr /* plTxnReplaced */, false /* bypass_limits */, max_tx_fee)) { - err_string = FormatStateMessage(state); + err_string = state.ToString(); if (state.IsInvalid()) { if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) { return TransactionError::MISSING_INPUTS; |