Browse Source
This commit just moves a few function declarations and updates callers. Function bodies are moved in two followup MOVEONLY commits. This change is desirable because wallet.h/cpp are monolithic and hard to navigate, so pulling things out and grouping together pieces of related functionality should improve the organization. Another proximate motivation is the wallet process separation work in https://github.com/bitcoin/bitcoin/pull/10973, where (at least initially) parameter parsing and fee estimation are still done in the main process rather than the wallet process, and having functions that run in different processes scrambled up throughout wallet.cpp is unnecessarily confusing.0.16
Russell Yanofsky
8 years ago
13 changed files with 117 additions and 50 deletions
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2017 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "wallet/fees.h" |
||||
|
||||
#include "policy/policy.h" |
||||
#include "txmempool.h" |
||||
#include "util.h" |
||||
#include "validation.h" |
||||
#include "wallet/coincontrol.h" |
||||
#include "wallet/wallet.h" |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2017 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_WALLET_FEES_H |
||||
#define BITCOIN_WALLET_FEES_H |
||||
|
||||
#include "amount.h" |
||||
|
||||
class CBlockPolicyEstimator; |
||||
class CCoinControl; |
||||
class CFeeRate; |
||||
class CTxMemPool; |
||||
struct FeeCalculation; |
||||
|
||||
/**
|
||||
* Return the minimum required fee taking into account the |
||||
* floating relay fee and user set minimum transaction fee |
||||
*/ |
||||
CAmount GetRequiredFee(unsigned int nTxBytes); |
||||
|
||||
/**
|
||||
* Estimate the minimum fee considering user set parameters |
||||
* and the required fee |
||||
*/ |
||||
CAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl& coin_control, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation *feeCalc); |
||||
|
||||
/**
|
||||
* Return the maximum feerate for discarding change. |
||||
*/ |
||||
CFeeRate GetDiscardRate(const CBlockPolicyEstimator& estimator); |
||||
|
||||
#endif // BITCOIN_WALLET_FEES_H
|
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2017 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "wallet/init.h" |
||||
|
||||
#include "net.h" |
||||
#include "util.h" |
||||
#include "utilmoneystr.h" |
||||
#include "validation.h" |
||||
#include "wallet/wallet.h" |
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2017 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_WALLET_INIT_H |
||||
#define BITCOIN_WALLET_INIT_H |
||||
|
||||
#include <string> |
||||
|
||||
//! Return the wallets help message.
|
||||
std::string GetWalletHelpString(bool showDebug); |
||||
|
||||
//! Wallets parameter interaction
|
||||
bool WalletParameterInteraction(); |
||||
|
||||
//! Responsible for reading and validating the -wallet arguments and verifying the wallet database.
|
||||
// This function will perform salvage on the wallet if requested, as long as only one wallet is
|
||||
// being loaded (CWallet::ParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet).
|
||||
bool WalletVerify(); |
||||
|
||||
//! Load wallet databases.
|
||||
bool InitLoadWallet(); |
||||
|
||||
#endif // BITCOIN_WALLET_INIT_H
|
Loading…
Reference in new issue