mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge #15638: Move-only: Pull wallet code out of libbitcoin_server
4d074e84a2[build] Move AnalyzePSBT from psbt.cpp to node/psbt.cpp (Russell Yanofsky)fd509bd1f7[docs] Document src subdirectories and different libraries (John Newbery)9eaeb7fb8d[build] Move wallet load functions to wallet/load unit (John Newbery)91a25d1e71[build] Add several util units (John Newbery)99517866b6[build] Move several units into common libraries (John Newbery)0509465542[build] Move rpc rawtransaction util functions to rpc/rawtransaction_util.cpp (John Newbery)1acc61f874[build] Move rpc utility methods to rpc/util (John Newbery)4a75c9d651[build] Move policy settings to new src/policy/settings unit (John Newbery)fdf8888b6f[build] Move CheckTransaction from lib_server to lib_consensus (John Newbery) Pull request description: This is a move-only commit. No code is changing and the moves can be easily verified with: ```sh git log -p -n1 --color-moved=dimmed_zebra ``` This commit moves functions and variables that wallet code depends on out of libbitcoin_server.a, so the bitcoin-wallet tool can be built without libbitcoin_server.a in #15639, and attempting to access server state from wallet code will result in link errors instead of silently broken code. List of moves: - `CheckTransaction` moves from `consensus/tx_verify.cpp` to `consensus/tx_check.cpp` - `urlDecode` moves from `httpserver.cpp` to `util/url.cpp` - `TransactionErrorString` moves from `node/transaction.cpp` to `util/error.cpp` - `StringForFeeReason` and `FeeModeFromString` move from `policy/fees.cpp` to `util/fees.cpp` - `incrementalRelayFee` `dustRelayFee` and `nBytesPerSigOp` move from `policy/policy.cpp` to `policy/settings.cpp` - `SignalsOptInRBF` moves from `policy/rbf.cpp` to `util/rbf.cpp` - `fIsBareMultisigStd` moves from `validation.cpp` to `policy/settings.cpp` - `ConstructTransaction` `TxInErrorToJSON` and `SignTransaction` move from `rpc/rawtransaction.cpp` to `rpc/rawtransaction_util.cpp` - `RPCTypeCheck` `RPCTypeCheckArgument` `RPCTypeCheckObj` `AmountFromValue` `ParseHashV``ParseHashO` `ParseHexV` `ParseHexO` `HelpExampleCli` and `HelpExampleRpc` move from `rpc/server.cpp` to `rpc/util.cpp` - `AmountHighWarn` and `AmountErrMsg` move from `ui_interface.cpp` to `util/error.cpp` - `FormatStateMessage` and `strMessageMagic` move from `validation.cpp` to `util/validation.cpp` - `VerifyWallets` `LoadWallets` `StartWallets` `FlushWallets` `StopWallets` and `UnloadWallets` move from `wallet/init.cpp` to `wallet/node.cpp` ACKs for commit 4d074e: jnewbery: utACK4d074e84a2(checked by doing the rebase myself and verifying no difference between my branch and4d074e84a2) Tree-SHA512: 5e1604a9fb06475f2b96da0de0baa8330f4dda834dc20a0183ef11e1e4c27631d1d1bbb9abf0054efc03d56945fdf9920f63366b6a4f200f665b742a479ff75c
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <checkqueue.h>
|
||||
#include <consensus/consensus.h>
|
||||
#include <consensus/merkle.h>
|
||||
#include <consensus/tx_check.h>
|
||||
#include <consensus/tx_verify.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <cuckoocache.h>
|
||||
@@ -21,6 +22,7 @@
|
||||
#include <policy/fees.h>
|
||||
#include <policy/policy.h>
|
||||
#include <policy/rbf.h>
|
||||
#include <policy/settings.h>
|
||||
#include <pow.h>
|
||||
#include <primitives/block.h>
|
||||
#include <primitives/transaction.h>
|
||||
@@ -37,8 +39,10 @@
|
||||
#include <ui_interface.h>
|
||||
#include <undo.h>
|
||||
#include <util/moneystr.h>
|
||||
#include <util/rbf.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
#include <util/validation.h>
|
||||
#include <validationinterface.h>
|
||||
#include <warnings.h>
|
||||
|
||||
@@ -236,7 +240,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;
|
||||
@@ -258,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;
|
||||
@@ -461,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);
|
||||
|
||||
Reference in New Issue
Block a user