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
Josh Wilcox
crown-core
Commits
8d7cec5c
Commit
8d7cec5c
authored
9 years ago
by
Evan Duffield
Browse files
Options
Download
Email Patches
Plain Diff
Dont accept MNW from older masternodes
parent
c425bbba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/masternode-payments.cpp
+16
-7
src/masternode-payments.cpp
src/version.h
+3
-0
src/version.h
with
19 additions
and
7 deletions
+19
-7
src/masternode-payments.cpp
View file @
8d7cec5c
...
...
@@ -324,9 +324,7 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int64_t nFe
}
int
CMasternodePayments
::
GetMinMasternodePaymentsProto
()
{
return
IsSporkActive
(
SPORK_10_MASTERNODE_PAY_NEWEST_NODES
)
?
MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2
:
MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1
;
return
MIN_MNW_PEER_PROTO_VERSION
;
}
void
CMasternodePayments
::
ProcessMessageMasternodePayments
(
CNode
*
pfrom
,
std
::
string
&
strCommand
,
CDataStream
&
vRecv
)
...
...
@@ -593,17 +591,28 @@ bool CMasternodePaymentWinner::IsValid(std::string& strError)
{
if
(
IsReferenceNode
(
vinMasternode
))
return
true
;
int
n
=
mnodeman
.
GetMasternodeRank
(
vinMasternode
,
nBlockHeight
-
100
,
masternodePayments
.
GetMinMasternodePaymentsProto
());
CMasternode
*
pmn
=
mnodeman
.
Find
(
vinMasternode
);
if
(
!
pmn
)
{
strError
=
strprintf
(
"Unknown Masternode %s"
,
vinMasternode
.
prevout
.
ToStringShort
());
LogPrintf
(
"CMasternodePaymentWinner::IsValid - %s
\n
"
,
strError
);
return
false
;
}
if
(
n
==
-
1
)
if
(
pmn
->
protocolVersion
<
GetMinMasternodePaymentsProto
()
)
{
LogPrintf
(
"CMasternodePaymentWinner::IsValid - Unknown Masternode - %s
\n
"
,
vinMasternode
.
ToString
().
c_str
());
strError
=
strprintf
(
"Masternode protocol too old %d - req %d"
,
pmn
->
protocolVersion
,
GetMinMasternodePaymentsProto
());
LogPrintf
(
"CMasternodePaymentWinner::IsValid - %s
\n
"
,
strError
);
return
false
;
}
int
n
=
mnodeman
.
GetMasternodeRank
(
vinMasternode
,
nBlockHeight
-
100
,
masternodePayments
.
GetMinMasternodePaymentsProto
());
if
(
n
>
MNPAYMENTS_SIGNATURES_TOTAL
)
{
LogPrintf
(
"CMasternodePaymentWinner::IsValid - Masternode not in the top %d (%d)
\n
"
,
MNPAYMENTS_SIGNATURES_TOTAL
,
n
);
strError
=
strprintf
(
"Masternode not in the top %d (%d)"
,
MNPAYMENTS_SIGNATURES_TOTAL
,
n
);
LogPrintf
(
"CMasternodePaymentWinner::IsValid - %s
\n
"
,
strError
);
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
src/version.h
View file @
8d7cec5c
...
...
@@ -27,6 +27,9 @@ static const int MIN_POOL_PEER_PROTO_VERSION = 70093;
//! minimum peer version for masternode budgets
static
const
int
MIN_BUDGET_PEER_PROTO_VERSION
=
70093
;
//! minimum peer version for masternode winner broadcasts
static
const
int
MIN_MNW_PEER_PROTO_VERSION
=
70093
;
//! minimum peer version that can receive masternode payments
// V1 - Last protocol version before update
// V2 - Newest protocol version
...
...
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