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
Tom
crown-core
Commits
bd3e46fa
Commit
bd3e46fa
authored
6 years ago
by
Volodymyr Shamray
Browse files
Options
Download
Email Patches
Plain Diff
Add obsolete nodes disconnection on spork activation
parent
e5ba42a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+0
-1
src/main.cpp
src/spork.cpp
+14
-5
src/spork.cpp
with
14 additions
and
6 deletions
+14
-6
src/main.cpp
View file @
bd3e46fa
...
...
@@ -4405,7 +4405,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
if (pfrom->nVersion < MinPeerProtoVersion())
{
// disconnect from peers older than this proto version
// Sunday, April 1, 2018 12:00:00 AM
LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion);
pfrom->PushMessage("reject", strCommand, REJECT_OBSOLETE,
strprintf("Version must be %d or greater", MinPeerProtoVersion()));
...
...
This diff is collapsed.
Click to expand it.
src/spork.cpp
View file @
bd3e46fa
...
...
@@ -133,16 +133,25 @@ int64_t GetSporkValue(int nSporkID)
void
ExecuteSpork
(
int
nSporkID
,
int
nValue
)
{
if
(
nSporkID
==
SPORK_11_RESET_BUDGET
&&
nValue
==
1
){
if
(
nSporkID
==
SPORK_11_RESET_BUDGET
&&
nValue
==
1
)
{
budget
.
Clear
();
}
//correct fork via spork technology
if
(
nSporkID
==
SPORK_12_RECONSIDER_BLOCKS
&&
nValue
>
0
)
{
else
if
(
nSporkID
==
SPORK_12_RECONSIDER_BLOCKS
&&
nValue
>
0
)
{
//correct fork via spork technology
LogPrintf
(
"Spork::ExecuteSpork -- Reconsider Last %d Blocks
\n
"
,
nValue
);
ReprocessBlocks
(
nValue
);
}
else
if
(
nSporkID
==
SPORK_16_DISCONNECT_OLD_NODES
&&
nValue
==
1
)
{
LOCK
(
cs_vNodes
);
for
(
auto
node
:
vNodes
)
{
if
(
node
->
nVersion
<
MinPeerProtoVersion
())
node
->
fDisconnect
=
true
;
}
}
}
void
ReprocessBlocks
(
int
nBlocks
)
...
...
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