Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
deploymentinfo.cpp
Go to the documentation of this file.
1
// Copyright (c) 2016-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
deploymentinfo.h
>
6
7
#include <
consensus/params.h
>
8
9
#include <string_view>
10
11
const
std::array<VBDeploymentInfo,Consensus::MAX_VERSION_BITS_DEPLOYMENTS>
VersionBitsDeploymentInfo
{
12
VBDeploymentInfo
{
13
.name =
"testdummy"
,
14
.gbt_optional_rule =
true
,
15
},
16
VBDeploymentInfo
{
17
.name =
"taproot"
,
18
.gbt_optional_rule =
true
,
19
},
20
};
21
22
std::string
DeploymentName
(
Consensus::BuriedDeployment
dep)
23
{
24
assert
(ValidDeployment(dep));
25
switch
(dep) {
26
case
Consensus::DEPLOYMENT_HEIGHTINCB
:
27
return
"bip34"
;
28
case
Consensus::DEPLOYMENT_CLTV
:
29
return
"bip65"
;
30
case
Consensus::DEPLOYMENT_DERSIG
:
31
return
"bip66"
;
32
case
Consensus::DEPLOYMENT_CSV
:
33
return
"csv"
;
34
case
Consensus::DEPLOYMENT_SEGWIT
:
35
return
"segwit"
;
36
}
// no default case, so the compiler can warn about missing cases
37
return
""
;
38
}
39
40
std::optional<Consensus::BuriedDeployment>
GetBuriedDeployment
(
const
std::string_view
name
)
41
{
42
if
(
name
==
"segwit"
) {
43
return
Consensus::BuriedDeployment::DEPLOYMENT_SEGWIT
;
44
}
else
if
(
name
==
"bip34"
) {
45
return
Consensus::BuriedDeployment::DEPLOYMENT_HEIGHTINCB
;
46
}
else
if
(
name
==
"dersig"
) {
47
return
Consensus::BuriedDeployment::DEPLOYMENT_DERSIG
;
48
}
else
if
(
name
==
"cltv"
) {
49
return
Consensus::BuriedDeployment::DEPLOYMENT_CLTV
;
50
}
else
if
(
name
==
"csv"
) {
51
return
Consensus::BuriedDeployment::DEPLOYMENT_CSV
;
52
}
53
return
std::nullopt;
54
}
GetBuriedDeployment
std::optional< Consensus::BuriedDeployment > GetBuriedDeployment(const std::string_view name)
Definition
deploymentinfo.cpp:40
DeploymentName
std::string DeploymentName(Consensus::BuriedDeployment dep)
Definition
deploymentinfo.cpp:22
VersionBitsDeploymentInfo
const std::array< VBDeploymentInfo, Consensus::MAX_VERSION_BITS_DEPLOYMENTS > VersionBitsDeploymentInfo
Definition
deploymentinfo.cpp:11
deploymentinfo.h
Consensus::BuriedDeployment
BuriedDeployment
A buried deployment is one where the height of the activation has been hardcoded into the client impl...
Definition
params.h:24
Consensus::DEPLOYMENT_DERSIG
@ DEPLOYMENT_DERSIG
Definition
params.h:28
Consensus::DEPLOYMENT_CSV
@ DEPLOYMENT_CSV
Definition
params.h:29
Consensus::DEPLOYMENT_SEGWIT
@ DEPLOYMENT_SEGWIT
Definition
params.h:30
Consensus::DEPLOYMENT_HEIGHTINCB
@ DEPLOYMENT_HEIGHTINCB
Definition
params.h:26
Consensus::DEPLOYMENT_CLTV
@ DEPLOYMENT_CLTV
Definition
params.h:27
params.h
name
const char * name
Definition
rest.cpp:48
VBDeploymentInfo
Definition
deploymentinfo.h:16
assert
assert(!tx.IsCoinBase())
Generated on
for Bitcoin Core by
1.17.0