-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V0.12.1.x govobj sync #864
V0.12.1.x govobj sync #864
Conversation
eduffield222
commented
Jun 3, 2016
- disable fCached values
- use two maps for storing votes, by hash and parent-hash/type
- disable part of flatdb.dump (still overwriting)
- fixed govobj/votes relay and sync
320adc4
to
e558daf
Compare
- disable fCached values - use two maps for storing votes, by hash and parent-hash/type - disable part of flatdb.dump (still overwriting) - fixed govobj/votes relay and sync
e558daf
to
487674f
Compare
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70066; | ||
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70103; | ||
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70103; | ||
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt it be '70201'? '70200' was a internal testnet version that will never make it to mainnet.
some nits but utACK |
|
||
// NEW GOVERNANCE OBJECT | ||
|
||
if (strCommand == NetMsgType::MNGOVERNANCEOBJECT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be else if
to follow the same style as in other ProcessMessage
- Uncommented sync block - Protocol min 70201 - Fixed bug which flags invalid votes incorrectly - Formatting
if(vote.nTime - mapVotes[hash2].nTime < GOVERNANCE_UPDATE_MIN){ | ||
strError = strprintf("time between votes is too soon - %s - %lli", vote.GetHash().ToString(), vote.nTime - mapVotes[hash2].nTime); | ||
if(vote.nTime - mapVotesByType[nTypeHash].nTime < GOVERNANCE_UPDATE_MIN){ | ||
strError = strprintf("time between votes is too soon - %s - %lli", nTypeHash.ToString(), vote.nTime - mapVotesByType[nHash].nTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo mapVotesByType[nHash]
-> mapVotesByType[nTypeHash]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general: looks much cleaner now so after this ^^^ is addressed imo we are good to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, that is correct, but upon further review there was a bug in GetTypeHash. I've added some comments to the code to make the intention clearer. We're trying to track when masternodes update their votes on governance objects. With 12.1 there's various types of votes (funding, valid, delete, etc), so this is the deterministic hash that will collide with the previous vote and allow the system to update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. ok, I missed the one in GetTypeHash()
:) but shouldn't mapVotesByType
be indexed via nTypeHash
and not nHash
here anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha, yes. updated... I think we're good to go now?
- Should not collide based on the outcome
ACK squash merge 732a8a3 :) |
@UdjinM6 @schinzelh : I noted "squash merge" in a couple of PRs recently. Does this mean I don't have to squash all my commits into one myself anymore? |
@crowning- Yep, github introduced this wonderfull "squash and merge" option |