Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115000
config.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
config.h
View Options
// Copyright (c) 2017 Amaury SÉCHET
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CONFIG_H
#define BITCOIN_CONFIG_H
#include
<boost/noncopyable.hpp>
#include
<cstdint>
class
CChainParams
;
class
Config
:
public
boost
::
noncopyable
{
public
:
virtual
bool
SetMaxBlockSize
(
uint64_t
maxBlockSize
)
=
0
;
virtual
uint64_t
GetMaxBlockSize
()
const
=
0
;
virtual
bool
SetBlockPriorityPercentage
(
int64_t
blockPriorityPercentage
)
=
0
;
virtual
uint8_t
GetBlockPriorityPercentage
()
const
=
0
;
virtual
const
CChainParams
&
GetChainParams
()
const
=
0
;
virtual
void
SetCashAddrEncoding
(
bool
)
=
0
;
virtual
bool
UseCashAddrEncoding
()
const
=
0
;
};
class
GlobalConfig
final
:
public
Config
{
public
:
GlobalConfig
();
bool
SetMaxBlockSize
(
uint64_t
maxBlockSize
);
uint64_t
GetMaxBlockSize
()
const
;
bool
SetBlockPriorityPercentage
(
int64_t
blockPriorityPercentage
);
uint8_t
GetBlockPriorityPercentage
()
const
;
const
CChainParams
&
GetChainParams
()
const
;
void
SetCashAddrEncoding
(
bool
)
override
;
bool
UseCashAddrEncoding
()
const
override
;
private
:
bool
useCashAddr
;
};
// Dummy for subclassing in unittests
class
DummyConfig
:
public
Config
{
public
:
bool
SetMaxBlockSize
(
uint64_t
maxBlockSize
)
override
{
return
false
;
}
uint64_t
GetMaxBlockSize
()
const
override
{
return
0
;
}
bool
SetBlockPriorityPercentage
(
int64_t
blockPriorityPercentage
)
override
{
return
false
;
}
uint8_t
GetBlockPriorityPercentage
()
const
override
{
return
0
;
}
const
CChainParams
&
GetChainParams
()
const
override
;
void
SetCashAddrEncoding
(
bool
)
override
{}
bool
UseCashAddrEncoding
()
const
override
{
return
false
;
}
};
// Temporary woraround.
const
Config
&
GetConfig
();
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Mar 2, 09:10 (23 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187168
Default Alt Text
config.h (1 KB)
Attached To
rABC Bitcoin ABC
Event Timeline
Log In to Comment