From fdf8888b6f0c63e8a4cb1459752625e642d6a4dd Mon Sep 17 00:00:00 2001 From: John Newbery Date: Tue, 2 Apr 2019 13:41:12 -0400 Subject: [build] Move CheckTransaction from lib_server to lib_consensus CheckTransaction is a context-free function that does not require access to the blockchain or mempool. Move it from src/consensus/tx_verify in lib_server to a new unit src/consensus/tx_check in lib_consensus so that it can be called by non-server libraries. --- src/validation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index ae3985485e..88a7ba9fd4 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 4a75c9d6512a5580e60104103ea11d2cd9586354 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Tue, 2 Apr 2019 14:14:58 -0400 Subject: [build] Move policy settings to new src/policy/settings unit This moves the following policy settings functions and globals to a new src/policy/settings unit in lib_server: - `incrementalRelayFee` - `dustRelayFee` - `nBytesPerSigOp` - `fIsBareMultisigStd` These settings are only required by the node and should not be accessed by other libraries. --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index 88a7ba9fd4..8cdc7a9273 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -237,7 +238,6 @@ std::atomic_bool fImporting(false); std::atomic_bool fReindex(false); bool fHavePruned = false; bool fPruneMode = false; -bool fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG; bool fRequireStandard = true; bool fCheckBlockIndex = false; bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED; -- cgit v1.2.3 From 91a25d1e711bfc0617027eee18b9777ff368d6b9 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Tue, 2 Apr 2019 17:03:37 -0400 Subject: [build] Add several util units Adds the following util units and adds them to libbitcoin_util: - `util/url.cpp` takes `urlDecode` from `httpserver.cpp` - `util/error.cpp` takes `TransactionErrorString` from `node/transaction.cpp` and `AmountHighWarn` and `AmountErrMsg` from `ui_interface.cpp` - `util/fees.cpp` takes `StringForFeeReason` and `FeeModeFromString` from `policy/fees.cpp` - `util/rbf.cpp` takes `SignalsOptInRBF` from `policy/rbf.cpp` - 'util/validation.cpp` takes `FormatStateMessage` and `strMessageMagic` from 'validation.cpp` --- src/validation.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index 8cdc7a9273..b681d7b757 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -39,8 +39,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -259,8 +261,6 @@ std::atomic_bool g_is_mempool_loaded{false}; /** Constant stuff for coinbase transactions we create: */ CScript COINBASE_FLAGS; -const std::string strMessageMagic = "Bitcoin Signed Message:\n"; - // Internal stuff namespace { CBlockIndex *&pindexBestInvalid = g_chainstate.pindexBestInvalid; @@ -462,15 +462,6 @@ static void LimitMempoolSize(CTxMemPool& pool, size_t limit, unsigned long age) pcoinsTip->Uncache(removed); } -/** Convert CValidationState to a human-readable message for logging */ -std::string FormatStateMessage(const CValidationState &state) -{ - return strprintf("%s%s (code %i)", - state.GetRejectReason(), - state.GetDebugMessage().empty() ? "" : ", "+state.GetDebugMessage(), - state.GetRejectCode()); -} - static bool IsCurrentForFeeEstimation() EXCLUSIVE_LOCKS_REQUIRED(cs_main) { AssertLockHeld(cs_main); -- cgit v1.2.3