Changeset View
Changeset View
Standalone View
Standalone View
src/config.h
// Copyright (c) 2017 Amaury SÉCHET | // Copyright (c) 2017 Amaury SÉCHET | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_CONFIG_H | #ifndef BITCOIN_CONFIG_H | ||||
#define BITCOIN_CONFIG_H | #define BITCOIN_CONFIG_H | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <feerate.h> | #include <feerate.h> | ||||
#include <boost/noncopyable.hpp> | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
class CChainParams; | class CChainParams; | ||||
class Config : public boost::noncopyable { | class Config { | ||||
public: | public: | ||||
virtual bool SetMaxBlockSize(uint64_t maxBlockSize) = 0; | virtual bool SetMaxBlockSize(uint64_t maxBlockSize) = 0; | ||||
virtual uint64_t GetMaxBlockSize() const = 0; | virtual uint64_t GetMaxBlockSize() const = 0; | ||||
virtual const CChainParams &GetChainParams() const = 0; | virtual const CChainParams &GetChainParams() const = 0; | ||||
virtual void SetCashAddrEncoding(bool) = 0; | virtual void SetCashAddrEncoding(bool) = 0; | ||||
virtual bool UseCashAddrEncoding() const = 0; | virtual bool UseCashAddrEncoding() const = 0; | ||||
virtual void SetExcessUTXOCharge(Amount amt) = 0; | virtual void SetExcessUTXOCharge(Amount amt) = 0; | ||||
virtual Amount GetExcessUTXOCharge() const = 0; | virtual Amount GetExcessUTXOCharge() const = 0; | ||||
Config() = default; | |||||
Config(const Config &) = delete; | |||||
Config &operator=(const Config &) = delete; | |||||
}; | }; | ||||
class GlobalConfig final : public Config { | class GlobalConfig final : public Config { | ||||
public: | public: | ||||
GlobalConfig(); | GlobalConfig(); | ||||
bool SetMaxBlockSize(uint64_t maxBlockSize) override; | bool SetMaxBlockSize(uint64_t maxBlockSize) override; | ||||
uint64_t GetMaxBlockSize() const override; | uint64_t GetMaxBlockSize() const override; | ||||
const CChainParams &GetChainParams() const override; | const CChainParams &GetChainParams() const override; | ||||
Show All 40 Lines |