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
e31f387e
Commit
e31f387e
authored
9 years ago
by
Evan Duffield
Browse files
Options
Download
Email Patches
Plain Diff
Disable multisig proposals / IsScheduled read ahead 8 blocks
parent
adcb7c7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/masternode-budget.cpp
+9
-0
src/masternode-budget.cpp
src/masternode-payments.cpp
+2
-2
src/masternode-payments.cpp
src/masternodeman.cpp
+3
-3
src/masternodeman.cpp
with
14 additions
and
5 deletions
+14
-5
src/masternode-budget.cpp
View file @
e31f387e
...
...
@@ -1075,8 +1075,17 @@ bool CBudgetProposal::IsValid(std::string& strError, bool fCheckCollateral)
}
}
/*
TODO: There might be an issue with multisig in the coinbase on mainnet, we will add support for it in a future release.
*/
if
(
address
.
IsPayToScriptHash
())
{
strError
=
"Multisig is not currently supported."
return
false
;
}
//if proposal doesn't gain traction within 2 weeks, remove it
// nTime not being saved correctly
// -- TODO: We should keep track of the last time the proposal was valid, if it's invalid for 2 weeks, erase it
// if(nTime + (60*60*24*2) < GetAdjustedTime()) {
// if(GetYeas()-GetNays() < (mnodeman.CountEnabled(MIN_BUDGET_PEER_PROTO_VERSION)/10)) {
// strError = "Not enough support";
...
...
This diff is collapsed.
Click to expand it.
src/masternode-payments.cpp
View file @
e31f387e
...
...
@@ -428,7 +428,7 @@ bool CMasternodePayments::GetBlockPayee(int nBlockHeight, CScript& payee)
}
// Is this masternode scheduled to get paid soon?
// -- Only look ahead up to
7
blocks to allow for propagation
// -- Only look ahead up to
8
blocks to allow for propagation
of the latest 2 winners
bool
CMasternodePayments
::
IsScheduled
(
CMasternode
&
mn
,
int
nNotBlockHeight
)
{
CBlockIndex
*
pindexPrev
=
chainActive
.
Tip
();
...
...
@@ -438,7 +438,7 @@ bool CMasternodePayments::IsScheduled(CMasternode& mn, int nNotBlockHeight)
mnpayee
=
GetScriptForDestination
(
mn
.
pubkey
.
GetID
());
CScript
payee
;
for
(
int64_t
h
=
pindexPrev
->
nHeight
;
h
<=
pindexPrev
->
nHeight
+
7
;
h
++
){
for
(
int64_t
h
=
pindexPrev
->
nHeight
;
h
<=
pindexPrev
->
nHeight
+
8
;
h
++
){
if
(
h
==
nNotBlockHeight
)
continue
;
if
(
mapMasternodeBlocks
.
count
(
h
)){
if
(
mapMasternodeBlocks
[
h
].
GetPayee
(
payee
)){
...
...
This diff is collapsed.
Click to expand it.
src/masternodeman.cpp
View file @
e31f387e
...
...
@@ -407,7 +407,7 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
// //check protocol version
if
(
mn
.
protocolVersion
<
masternodePayments
.
GetMinMasternodePaymentsProto
())
continue
;
//it's in the list (up to
7
entries ahead of current block to allow propagation) -- so let's skip it
//it's in the list (up to
8
entries ahead of current block to allow propagation) -- so let's skip it
if
(
masternodePayments
.
IsScheduled
(
mn
,
nBlockHeight
))
continue
;
//make sure it has as many confirmations as there are masternodes
...
...
@@ -420,8 +420,8 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
sort
(
vecMasternodeLastPaid
.
rbegin
(),
vecMasternodeLastPaid
.
rend
(),
CompareValueOnly
());
// Look at 1/10 of the oldest nodes (by last payment), calculate their scores and pay the best one
// -- This doesn't look at who is being paid in the +
7
-10 blocks, allowing for double payments very rarely
// -- 1/100 payments should be a double payment on mainnet - (1/(3000/10))*
3
--(chance per block * chances before IsScheduled will fire)
// -- This doesn't look at who is being paid in the +
8
-10 blocks, allowing for double payments very rarely
// -- 1/100 payments should be a double payment on mainnet - (1/(3000/10))*
2
--(chance per block * chances before IsScheduled will fire)
int
nTenthNetwork
=
mnodeman
.
CountEnabled
()
/
10
;
int
nCount
=
0
;
uint256
nHigh
=
0
;
...
...
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