/
minerfund.cpp
76 lines (62 loc) · 2.53 KB
/
minerfund.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) 2020 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <minerfund.h>
#include <chainparams.h>
#include <consensus/activation.h>
#include <key_io.h> // For DecodeDestination
#include <util/system.h>
#include <validation.h> // For VersionBitsBlockState
static CTxDestination BuildDestination(const std::string &dest) {
const auto mainNetParams = CreateChainParams(CBaseChainParams::MAIN);
return DecodeDestination(dest, *mainNetParams);
}
static const CTxDestination &GetMinerFundDestination() {
static CTxDestination dest =
BuildDestination("pqv2r67sgz3qumufap3h2uuj0zfmnzuv8vqhqfgddk");
return dest;
}
static const CTxDestination &GetMinerABCDestination() {
static CTxDestination dest =
BuildDestination("qzvz0es48sf8wrqy7kn5j5cugka95ztskcanc9laay");
return dest;
}
static const CTxDestination &GetMinerBCHDDestination() {
static CTxDestination dest =
BuildDestination("qrhea03074073ff3zv9whh0nggxc7k03ssh8jv9mkx");
return dest;
}
static const CTxDestination &GetMinerElectronCashDestination() {
static CTxDestination dest =
BuildDestination("pp8d685l8kecnmtyy52ndvq625arz2qwmu42qeeqek");
return dest;
}
std::vector<CTxDestination>
GetMinerFundWhitelist(const Consensus::Params ¶ms,
const CBlockIndex *pindexPrev) {
if (!gArgs.GetBoolArg("-enableminerfund", params.enableMinerFund)) {
return {};
}
if (!IsPhononEnabled(params, pindexPrev)) {
return {};
}
std::vector<CTxDestination> whitelist{};
if (VersionBitsBlockState(params, Consensus::DEPLOYEMENT_MINER_FUND,
pindexPrev) == ThresholdState::ACTIVE) {
whitelist.push_back(GetMinerFundDestination());
}
if (VersionBitsBlockState(params, Consensus::DEPLOYEMENT_MINER_FUND_ABC,
pindexPrev) == ThresholdState::ACTIVE) {
whitelist.push_back(GetMinerABCDestination());
}
if (VersionBitsBlockState(params, Consensus::DEPLOYEMENT_MINER_FUND_BCHD,
pindexPrev) == ThresholdState::ACTIVE) {
whitelist.push_back(GetMinerBCHDDestination());
}
if (VersionBitsBlockState(params,
Consensus::DEPLOYEMENT_MINER_FUND_ELECTRON_CASH,
pindexPrev) == ThresholdState::ACTIVE) {
whitelist.push_back(GetMinerElectronCashDestination());
}
return whitelist;
}