Files
thehub/libs/utils/SettingsDefaults.h
T

201 lines
6.1 KiB
C++
Raw Permalink Normal View History

2018-02-12 14:15:24 +01:00
/*
* This file is part of the Flowee project
2021-01-20 19:21:53 +01:00
* Copyright (C) 2018-2021 Tom Zander <tom@flowee.org>
2018-02-12 14:15:24 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SETTINGS_DEFAULTS_H
#define SETTINGS_DEFAULTS_H
#include "amount.h"
#include <string>
namespace Settings {
// /////// Validation
2021-01-20 19:45:15 +01:00
constexpr int DefaultCheckBlocks = 5;
constexpr uint32_t DefaultCheckLevel = 3;
2018-02-12 14:15:24 +01:00
// /////// NET
/** Default for -blocksizeacceptlimit */
2021-01-20 19:45:15 +01:00
constexpr int32_t DefaultBlockAcceptSize = 128000000;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultAcceptDataCarrier = true;
constexpr uint32_t MaxOpReturnRelay = 223; //! bytes (+1 for OP_RETURN, +2 for the pushdata opcodes)
constexpr bool DefaultRelayPriority = true;
2018-02-12 14:15:24 +01:00
/** Default for setting that we download and accept blocks only (no transactions, no mempool) */
2021-01-20 19:45:15 +01:00
constexpr bool DefaultBlocksOnly = false;
constexpr uint32_t DefaultBanscoreThreshold = 100;
2018-02-12 14:15:24 +01:00
// NOTE: When adjusting this, update rpcnet:setban's help ("24h")
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMisbehavingBantime = 60 * 60 * 24; // Default 24-hour ban
2018-02-12 14:15:24 +01:00
//! -dns default
2021-01-20 19:45:15 +01:00
constexpr int DefaultNameLookup = true;
2018-02-12 14:15:24 +01:00
/// download peers from DNS
2021-01-20 19:45:15 +01:00
constexpr bool DefaultForceDnsSeed = false;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr int DefaultHttpThreads=4;
constexpr int DefaultHttpWorkQueue=16;
constexpr int DefaultHttpServerTimeout=30;
2018-02-12 14:15:24 +01:00
/// Tor
2021-01-20 19:45:15 +01:00
constexpr bool DefaultListenOnion = false;
2018-02-12 14:15:24 +01:00
static const std::string DefaultTorControl = "127.0.0.1:9051";
/** The default for -maxuploadtarget. 0 = Unlimited */
2021-01-20 19:45:15 +01:00
constexpr uint64_t DefaultMaxUploadTarget = 0;
2018-02-12 14:15:24 +01:00
/** The maximum number of peer connections to maintain. */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMaxPeerConnections = 125;
2018-02-12 14:15:24 +01:00
/** The default minimum number of thin nodes to connect to */
2021-01-20 19:45:15 +01:00
constexpr int DefaultMinThinPeers = 0;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMaxReceiveBuffer = 5 * 1000;
constexpr uint32_t DefaultMaxSendBuffer = 1 * 1000;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr int DefaultMainnetPort = 8333;
constexpr int DefaultTestnetPort = 18333;
constexpr int DefaultTestnet4Port = 28333;
constexpr int DefaultScalenetPort = 38333;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultProxyRandomize = true;
2018-02-12 14:15:24 +01:00
//! -timeout default
2021-01-20 19:45:15 +01:00
constexpr int DefaultConnectTimeout = 5000;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultWhitelistRelay = true;
constexpr bool DefaultWhitelistForceRelay = true;
2018-02-12 14:15:24 +01:00
// /////// Mempool
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMaxOrphanTransactions = 5000;
2018-02-12 14:15:24 +01:00
/** Default for -maxmempool, maximum megabytes of mempool memory usage */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMaxMempoolSize = 300;
2018-02-12 14:15:24 +01:00
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMempoolExpiry = 5;
2018-02-12 14:15:24 +01:00
/** Default for -permitbaremultisig */
2021-01-20 19:45:15 +01:00
constexpr bool DefaultPermitBareMultisig = true;
2018-02-12 14:15:24 +01:00
/** Default for -limitancestorcount, max number of in-mempool ancestors */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultAncestorLimit = 50;
2018-02-12 14:15:24 +01:00
/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultAncestorSizeLimit = 101;
2018-02-12 14:15:24 +01:00
/** Default for -limitdescendantcount, max number of in-mempool descendants */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultDescendantLimit = 50;
2018-02-12 14:15:24 +01:00
/** Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultDescendantSizeLimit = 101;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultLimitFreeRelay = 15;
2018-02-12 14:15:24 +01:00
// ///////// Wallet
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultKeypoolSize = 100;
2018-02-12 14:15:24 +01:00
//! -fallbackfee default
2021-01-20 19:45:15 +01:00
constexpr int64_t DefaultFallbackFee = 20000;
2018-02-12 14:15:24 +01:00
//! -mintxfee default
2021-01-20 19:45:15 +01:00
constexpr int64_t DefaultTransactionMinfee = 1000;
2018-02-12 14:15:24 +01:00
//! -maxtxfee default
2021-01-20 19:45:15 +01:00
constexpr int64_t DefaultTransactionMaxFee= 0.1 * COIN;
2018-02-12 14:15:24 +01:00
//! -paytxfee default
2021-01-20 19:45:15 +01:00
constexpr int64_t DefaultTransactionFee = 0;
2018-02-12 14:15:24 +01:00
//! Default for -sendfreetransactions
2021-01-20 19:45:15 +01:00
constexpr bool DefaultSendFreeTransactions = false;
2018-02-12 14:15:24 +01:00
//! Default for -spendzeroconfchange
2021-01-20 19:45:15 +01:00
constexpr bool DefaultSpendZeroconfChange = true;
2018-02-12 14:15:24 +01:00
//! -txconfirmtarget default
2021-01-20 19:45:15 +01:00
constexpr uint32_t defaultTxConfirmTarget = 2;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultWalletBroadcast = true;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultWalletDBLogSize = 100;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultFlushWallet = true;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultWalletPrivDb = true;
2018-02-12 14:15:24 +01:00
// //// config (soo meta)
inline const char * hubPidFilename() {
return "floweethehub.pid";
}
inline const char * hubConfFilename() {
return "flowee.conf";
}
// //// Mining
/** Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create **/
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultBlockMAxSize = 8000000;
constexpr uint32_t DefaultBlockMinSize = 0;
2018-02-12 14:15:24 +01:00
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultBlockPrioritySize = 100000;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultGenerateCoins = false;
constexpr int DefaultGenerateThreads = 1;
constexpr bool DefaultGeneratePriorityLogging = false;
2018-02-12 14:15:24 +01:00
// /////// Qt GUI
2021-01-20 19:45:15 +01:00
constexpr bool DefaultChooseDatadir = false;
constexpr bool DefaultSelfsignedRootcerts = false;
constexpr bool DefaultSplashscreen = true;
2018-02-12 14:15:24 +01:00
static const std::string DefaultUIPlatform =
#if defined(Q_OS_MAC)
"macosx"
#elif defined(Q_OS_WIN)
"windows"
#else
"other"
#endif
;
2018-08-10 10:33:34 +03:00
// DoS prevention: limit cache size to 32MB (over 1000000 entries on 64-bit
2018-02-12 14:15:24 +01:00
// entries on 64-bit systems).
2018-08-10 10:33:34 +03:00
// systems). Due to how we count cache size, actual memory usage is slightly
// more (~32.25 MB)
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMaxSigCacheSize = 32;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultRestEnable = false;
constexpr bool DefaultDisableSafemode = false;
constexpr bool DefaultStopAfterBlockImport = false;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultCheckpointsEnabled = true;
2018-02-12 14:15:24 +01:00
2021-01-20 19:45:15 +01:00
constexpr bool DefaultTestSafeMode = false;
2018-02-12 14:15:24 +01:00
/** Default for -minrelaytxfee, minimum relay fee for transactions */
2021-01-20 19:45:15 +01:00
constexpr uint32_t DefaultMinRelayTxFee = 1000;
2018-02-12 14:15:24 +01:00
}
#endif