Skip to content

Commit cd7fa8b

Browse files
committed
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.
1 parent a943bde commit cd7fa8b

File tree

8 files changed

+8
-9
lines changed

8 files changed

+8
-9
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer)
534534
return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"].c_str()));
535535
}
536536

537+
#ifdef ENABLE_WALLET
537538
if (mapArgs.count("-paytxfee"))
538539
{
539540
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
@@ -542,7 +543,6 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer)
542543
InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction."));
543544
}
544545

545-
#ifdef ENABLE_WALLET
546546
strWalletFile = GetArg("-wallet", "wallet.dat");
547547
#endif
548548
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log

src/main.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ CScript COINBASE_FLAGS;
6767

6868
const string strMessageMagic = "Bitcoin Signed Message:\n";
6969

70-
// Settings
71-
int64_t nTransactionFee = 0;
72-
7370
// Internal stuff
7471
namespace {
7572
struct CBlockIndexWorkComparator

src/main.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ extern bool fTxIndex;
9696
extern unsigned int nCoinCacheSize;
9797
extern bool fHaveGUI;
9898

99-
// Settings
100-
extern int64_t nTransactionFee;
101-
10299
// Minimum disk space required - used in CheckDiskSpace()
103100
static const uint64_t nMinDiskSpace = 52428800;
104101

src/qt/bitcoin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "main.h"
1818
#include "ui_interface.h"
1919
#include "util.h"
20+
#include "wallet.h"
2021

2122
#include <stdint.h>
2223

src/qt/optionsmodel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "init.h"
1515
#include "main.h"
1616
#include "net.h"
17+
#include "wallet.h"
1718
#include "walletdb.h"
1819

1920
#include <QSettings>

src/rpcmisc.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ Value getinfo(const Array& params, bool fHelp)
7878
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
7979
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
8080
}
81-
#endif
8281
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
83-
#ifdef ENABLE_WALLET
8482
if (pwalletMain && pwalletMain->IsCrypted())
8583
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
8684
#endif

src/wallet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
using namespace std;
1818

19+
// Settings
20+
int64_t nTransactionFee = 0;
1921

2022
//////////////////////////////////////////////////////////////////////////////
2123
//

src/wallet.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#include <utility>
2424
#include <vector>
2525

26+
// Settings
27+
extern int64_t nTransactionFee;
28+
2629
class CAccountingEntry;
2730
class CCoinControl;
2831
class COutput;

0 commit comments

Comments
 (0)