From 4f519b0dace6ed3db610327305e077160ad11ea5 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 5 May 2014 20:54:00 +0200 Subject: [PATCH] add DEFAULT_TRANSACTION_FEE constant in wallet - as this is a shared Core/GUI setting, this makes it easier to keep them in sync (also no new includes are needed) --- src/qt/optionsmodel.cpp | 2 +- src/wallet.cpp | 4 ++-- src/wallet.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 8d6a00ae2..314d1f3d2 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -95,7 +95,7 @@ void OptionsModel::Init() // Wallet #ifdef ENABLE_WALLET if (!settings.contains("nTransactionFee")) - settings.setValue("nTransactionFee", 0); + settings.setValue("nTransactionFee", DEFAULT_TRANSACTION_FEE); nTransactionFee = settings.value("nTransactionFee").toLongLong(); // if -paytxfee is set, this will be overridden later in init.cpp if (mapArgs.count("-paytxfee")) addOverriddenOption("-paytxfee"); diff --git a/src/wallet.cpp b/src/wallet.cpp index 10b24b890..56b0d183d 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -7,9 +7,9 @@ #include "wallet.h" #include "base58.h" +#include "checkpoints.h" #include "coincontrol.h" #include "net.h" -#include "checkpoints.h" #include #include @@ -17,7 +17,7 @@ using namespace std; // Settings -int64_t nTransactionFee = 0; +int64_t nTransactionFee = DEFAULT_TRANSACTION_FEE; bool bSpendZeroConfChange = true; static std::vector vChangeAddresses; diff --git a/src/wallet.h b/src/wallet.h index 7814a9ba2..1fac70f8c 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -28,6 +28,8 @@ extern int64_t nTransactionFee; extern bool bSpendZeroConfChange; +// -paytxfee default +static const int64_t DEFAULT_TRANSACTION_FEE = 0; // -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB static const int nHighTransactionFeeWarning = 25 * COIN;