Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
defunctec
crown-core
Commits
409f8332
Commit
409f8332
authored
8 years ago
by
jl2012
Browse files
Options
Download
Email Patches
Plain Diff
RPC: Hide softfork if timeout is 0
parent
5cdc54b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rpc/blockchain.cpp
+12
-3
src/rpc/blockchain.cpp
with
12 additions
and
3 deletions
+12
-3
src/rpc/blockchain.cpp
View file @
409f8332
...
...
@@ -868,6 +868,15 @@ static UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Conse
return
rv
;
}
void
BIP9SoftForkDescPushBack
(
UniValue
&
bip9_softforks
,
const
std
::
string
&
name
,
const
Consensus
::
Params
&
consensusParams
,
Consensus
::
DeploymentPos
id
)
{
// Deployments with timeout value of 0 are hidden.
// A timeout value of 0 guarantees a softfork will never be activated.
// This is used when softfork codes are merged without specifying the deployment schedule.
if
(
consensusParams
.
vDeployments
[
id
].
nTimeout
>
0
)
bip9_softforks
.
push_back
(
Pair
(
name
,
BIP9SoftForkDesc
(
consensusParams
,
id
)));
}
UniValue
getblockchaininfo
(
const
UniValue
&
params
,
bool
fHelp
)
{
if
(
fHelp
||
params
.
size
()
!=
0
)
...
...
@@ -901,7 +910,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
" ],
\n
"
"
\"
bip9_softforks
\"
: { (object) status of BIP9 softforks in progress
\n
"
"
\"
xxxx
\"
: { (string) name of the softfork
\n
"
"
\"
status
\"
:
\"
xxxx
\"
, (string) one of
\"
defined
\"
,
\"
started
\"
,
\"
lockedin
\"
,
\"
active
\"
,
\"
failed
\"\n
"
"
\"
status
\"
:
\"
xxxx
\"
, (string) one of
\"
defined
\"
,
\"
started
\"
,
\"
locked
_
in
\"
,
\"
active
\"
,
\"
failed
\"\n
"
"
\"
bit
\"
: xx, (numeric) the bit, 0-28, in the block version field used to signal this soft fork
\n
"
"
\"
startTime
\"
: xx, (numeric) the minimum median time past of a block at which the bit gains its meaning
\n
"
"
\"
timeout
\"
: xx (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
\n
"
...
...
@@ -933,8 +942,8 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
softforks
.
push_back
(
SoftForkDesc
(
"bip34"
,
2
,
tip
,
consensusParams
));
softforks
.
push_back
(
SoftForkDesc
(
"bip66"
,
3
,
tip
,
consensusParams
));
softforks
.
push_back
(
SoftForkDesc
(
"bip65"
,
4
,
tip
,
consensusParams
));
bip9_s
oft
f
ork
s
.
p
ush
_b
ack
(
Pair
(
"csv"
,
BIP9S
oft
F
ork
Desc
(
consensusParams
,
Consensus
::
DEPLOYMENT_CSV
)
))
;
bip9_s
oft
f
ork
s
.
p
ush
_b
ack
(
Pair
(
"segwit"
,
BIP9SoftForkDesc
(
consensusParams
,
Consensus
::
DEPLOYMENT_SEGWIT
)
))
;
BIP9S
oft
F
ork
DescP
ush
B
ack
(
bip9_s
oft
f
ork
s
,
"csv"
,
consensusParams
,
Consensus
::
DEPLOYMENT_CSV
);
BIP9S
oft
F
ork
DescP
ush
B
ack
(
bip9_softforks
,
"segwit"
,
consensusParams
,
Consensus
::
DEPLOYMENT_SEGWIT
);
obj
.
push_back
(
Pair
(
"softforks"
,
softforks
));
obj
.
push_back
(
Pair
(
"bip9_softforks"
,
bip9_softforks
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help