Move `nTransactionFee` from main.cpp to wallet.cpp

Transaction fee is only used by the wallet.
No need for it to be in main.cpp.
This commit is contained in:
Wladimir J. van der Laan 2013-12-13 16:14:48 +01:00
parent a943bde6f0
commit cd7fa8bb43
8 changed files with 8 additions and 9 deletions

View File

@ -534,6 +534,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer)
return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"].c_str())); return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"].c_str()));
} }
#ifdef ENABLE_WALLET
if (mapArgs.count("-paytxfee")) if (mapArgs.count("-paytxfee"))
{ {
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee)) if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
@ -542,7 +543,6 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer)
InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction."));
} }
#ifdef ENABLE_WALLET
strWalletFile = GetArg("-wallet", "wallet.dat"); strWalletFile = GetArg("-wallet", "wallet.dat");
#endif #endif
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log // ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log

View File

@ -67,9 +67,6 @@ CScript COINBASE_FLAGS;
const string strMessageMagic = "Bitcoin Signed Message:\n"; const string strMessageMagic = "Bitcoin Signed Message:\n";
// Settings
int64_t nTransactionFee = 0;
// Internal stuff // Internal stuff
namespace { namespace {
struct CBlockIndexWorkComparator struct CBlockIndexWorkComparator

View File

@ -96,9 +96,6 @@ extern bool fTxIndex;
extern unsigned int nCoinCacheSize; extern unsigned int nCoinCacheSize;
extern bool fHaveGUI; extern bool fHaveGUI;
// Settings
extern int64_t nTransactionFee;
// Minimum disk space required - used in CheckDiskSpace() // Minimum disk space required - used in CheckDiskSpace()
static const uint64_t nMinDiskSpace = 52428800; static const uint64_t nMinDiskSpace = 52428800;

View File

@ -17,6 +17,7 @@
#include "main.h" #include "main.h"
#include "ui_interface.h" #include "ui_interface.h"
#include "util.h" #include "util.h"
#include "wallet.h"
#include <stdint.h> #include <stdint.h>

View File

@ -14,6 +14,7 @@
#include "init.h" #include "init.h"
#include "main.h" #include "main.h"
#include "net.h" #include "net.h"
#include "wallet.h"
#include "walletdb.h" #include "walletdb.h"
#include <QSettings> #include <QSettings>

View File

@ -78,9 +78,7 @@ Value getinfo(const Array& params, bool fHelp)
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime())); obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize())); obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
} }
#endif
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee))); obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
#ifdef ENABLE_WALLET
if (pwalletMain && pwalletMain->IsCrypted()) if (pwalletMain && pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime)); obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
#endif #endif

View File

@ -16,6 +16,8 @@
using namespace std; using namespace std;
// Settings
int64_t nTransactionFee = 0;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //

View File

@ -23,6 +23,9 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
// Settings
extern int64_t nTransactionFee;
class CAccountingEntry; class CAccountingEntry;
class CCoinControl; class CCoinControl;
class COutput; class COutput;