- some were not used, some were included twice, some were in the wrong place, some were missing (but it compiled because some were in the wrong place)
- organized a bit better, grouped dash specific includes in original bitcoin files, should save some time solving conflicts when/if merging patches later
- added description for 'deserialize'
- added 'type' filter to 'list'
- added 'count' command (changed CGovernanceManager::ToString to output a bit more detailed info)
* Vote relaying changes
- Remove vote relaying from ProcessVote
- Remove vote relaying from orphan vote processing
- Relay vote in ProcessMessages (only)
* Do not relay governance objects during orphan processing
* Restore relaying of local votes
* Changed overloaded function name: ProcessVote->ProcessVoteAndRelay
* Fix deadlocks by reducing scope of cs_main locks in rpcgovernance.cpp
* Remove unnecessary mutex lock in GetMasternodeVinAndKeys which can cause a deadlock
Squashed:
* Replaced unsafe mnodeman.Find function with Get in governance-vote.cpp
* Reject unparsable governance objects
* Implemented sentinel watchdog objects (separated out from locking changes)
* Added WATCHDOG support to rpcgovernance.cpp
* Implemented WATCHDOG_EXPIRED state for masternodes
* Added serialization of watchdog timestamps
* Masternode fixes
- Added version check to CMasternodeMan deserialization
- Added several missing locking calls in CMasternodeMan
* Fixed missing member initialization in CMasternode constructor and added more logging
* Added MASTERNODE_WATCHDOG_MAX_SECONDS to governanceinfo
* Added masternodewatchdogmaxseconds info to getgovernanceinfo help
* Make masternodes remain in WATCHDOG_EXPIRED state unless removed or collateral expires
* Allow watchdog object creation by WATCHDOG_EXPIRED MN
* Fixed MN validation logic for governance object creation
* Count total masternodes instead of enabled masternodes in masternode-sync
* Transition out of WATCHDOG_EXPIRED state if the watchdog is inactive
* Fixed IsWatchdogExpired bug
* Fixed rate check for watchdog objects and no longer check MN state when validating governance objects
* Applied PR #1061 patch
* Ported locking changes from other branch
* Require only 1 block between new watchdog objects
* Accept pings for WATCHDOG_EXPIRED masternodes
* Lock CmasternodeMan::cs in CmasternodeMan::ProcessMessage
* Several governance changes
- Fixed uninitialized value in CGovernancePayment class
- Return an error on submission if any superblock payment cannot be parsed
- Added logging more statements
* Explicitly initialize all governance object members
* Fix deadlock
* Fixed non-threadsafe access to masternode in activemasternode.cpp
* Revert added wallet lock
* Changed CActiveMasternode so that watchdog expired nodes can still send pings
* Modified CActiveMasternode to run pinger regardless of state when MN is in list
* Added voter and time information to getvotes command
* Improved CActiveMasternode state management
* Implemented GetInfo functions for more efficient thread-safe access to masternode information
* Added CActiveMasternode debug logging messages
* Fixed initial type setting and error message for incorrect protocol version
* Changes based on code review comments
* Set active state for local mode
* rpcgovernance improvements
- Modified govject get to return full object data along with vote counts
- Cleaned up vote count reporting code
* Added cached flags to gobject get output
* Fixes to rpcgovernance.cpp
- Replaced use of non-unique public key with vin in vote-conf, vote-alias and vote-many
- Replaced use of non-threadsafe CmasternodeMan::Find function with Get
- Added LOCK(cs_main) to getgovernanceinfo
* Fixed rpcgovernance.cpp voting error messages
* Implemented several governance changes
- Limit strData size to avoid propagation of very large messages
- Remove unused CGovernanceObject::SetData method
- Remove CGovernanceObject::strName field to avoid data redundancy
* Fixed parameter count bug in gobject prepare
* Remove unnecessary call to IsCollateralValid and hence allow superblocks
to propagate
* Added CMasternodeMan::Get overload for masternode vin
* Use vin as masternode identifier instead of public key
* Fixed missing member in copy constructor, improved logging
* Added logging for MasternodeRateCheck failures
* Removed pubkeyMasternode field from CGovernanceObject
* Impose MN trigger creation rate limit only when MN info is synced
* Improve rpcgovernance error handling
- Prevent attempts to prepare trigger objects (and waste the collateral)
- Improve clarity of gobject submit error messages
* trivial governance cleanup:
- spaces
- names
- no "using namespace std;"
- few log and rpc messages adjusted
- remove unused
- use defined types
- move few members to private
* fixing after code review
* consistent JSON return value for failed vote
* make JSON output for voting results consistent
* result should be either 'success' or 'failed'
* error message belongs in 'errorMessage' field
* Added more specific error message about attempts to submit superblocks by
non-masternodes
* Fixed governance object validation bug
* Fixed logic bug in governance object submission
* Improved exception handling
- Removed attempts to catch exceptions in intermediate helper function calls
- Made helper functions for JSON parsing private
* Governance voting fixes
- Converted voting defines to enums for better type safety
- Enabled gobject voteraw rpc command
- Removed unused parameter from gobject getvotes rpc command
* Fixed help message for gobject get
* Improved encapsulation of CGovernanceVote objects
- CGovernanceVote data members are now private
- Necessary to ensure that enum values are used for signals and outcomes since data members remain int's for compatibility with serialiation code
* Removed unused cs_budget mutex (has been replaced with governance.cs)
* Fix code review issues
- Restored early return in ConvertVoteSignal
- Removed special case for "none" string to make clear that NONE is
for invalid strings
- Removed commented defines (informational comments preserved)
* Fixed code review issues
- Fixed error messages for vote-conf, vote-alias and voteraw
- Removed voteraw from gobject command list and help messages because
it is actually a top-level command
- Fixed parameter indices for voteraw
* Bug fixes for the governance rpc interface
- Allow use of the gobject getvotes command
- Fix order of arguments to CGovernanceVote constructor
* Added getvotes to gobject help message and fixed parameter name in the
error/usage message.
* Implemented different fees for different types of governance objects
* Added fee amounts to object returned by getgovernanceinfo
* Implement new requireents for Superblock creation
- Superblocks creation requires a valid masternode signature
- Superblock creation no longer requires a collateral fee
- Superblock creation rate is limited to roughly 1 per masternode per cycle
* Fixed getgovernanceinfo help message
* Removed old governance fee constant
* Fixed bug in IsSignatureValid and added debugging code
* Fixed parent hash variable index and added debugging code
* Modified GetBudgetSystemCollateralTX to take fee amount parameter
* Changes due to code review comments
- Naming changes
- Removed confusing comment
f0ed400 darkSendSigner.SignMessage() should not return error message
154f1b6 darkSendSigner.VerifyMessage() should return non-localized message, its callers should populate error to debug.log
b130c32 darkSendSigner.GetKeysFromSecret() should not return error message, its callers should handle it
068c178 Added DBG macro in util.h to facilitate debugging
- This macro allows debugging statements (typically printf's or cout's) to
be activated or deactivated with a single comment. Uncomment the line:
//#define ENABLE_DASH_DEBUG
in util.h to enable debugging statements.
- When commented any code wrapped with the DBG() macro will simply be removed
by the preprocessor. When not commented all such wrapped statements will
be present.
- For maximum effectiveness it is best that util.h be the first effective include
in all source files. It is also possible to enable the macro for a single file
by temporarily adding #define ENABLE_DASH_DEBUG to the top of the file.
- Code committed to non-development branches should always have the define
commented.
d125d9b V0.12.1.x -- merging trigger/generic object/superblock changes for testnet phase II
- This commit contains the core governance system changes for 0.12.1. Any unrelated
changes have either been removed or moved to separate commits.
120724c File mode fixes
- Changed mode 0755->0644 on several source files.
c7f9e11 Updated todo reminders
- Added reminder to revert temporary reduction of number of votes
required to trigger superblock to 1 for testing
92adc98 Made CSuperblockManager::IsValidSuperblockHeight an inline function
- This is for efficiency since this function is called often and is
only 1 line of code.
c050ed7 Added comment explaining rationale for no LOCK(cs) in CSuperblock::IsValid
dc933fe Removed unused CSuperblockManager::IsBlockValid function
decec88 Moved calls to SuperblockManager::IsValidSuperblockHeight into IsSuperblockTriggered.
- Since calls to the later function are always protected by the former there's
no reason to keep these separate and this simplifies the code in
masternode-payments.cpp.
8672885 Reestablished expected value check for non-superblocks in IsBlockValueValid
b01cbe0 Changes to IsBlockValueValid to fix rpc test failure
a937c76 Changed include order to allow per file activation of the DBG macro
d116aa5 Fixed IsValidSuperblockHeight logic
- Note this has an effect on testing because we can now only create
1 superblock per day. Devs may need to temporarily change testnet params
for easier testing.
2d0c2de Convert superblock payments to CAmount
- We assume that payment values in JSON are in units of DASH
for consistency with other RPC functions, such as
createrawtransaction.
376b833 Revert temporary testing value for nAbsVoteReq
- Also ensure that number of votes required is never smaller than 1
8c89f4b Cleaned up CSuperblock error handling
- Exceptions are now thrown consistently rather than using a mix of
exceptions and return code checking. Exceptions are now caught only
in AddNewTrigger when the CSuperblock constructor is called. Unnecessary object
status members have been removed.
d7c8a6b Removed utilstrencodings header
- This appears to help with travis tests, for unknown reasons.
c4dfc7a Fixed some minor code review issues
63c3580 Reverted locking change in miner.
- This should have been done in the original PR but was overlooked.
4ab72de Fixed variable name to match common practice and bracket formatting
886a678 Improvements to vote conversion code
- Replaced redundantly defined function with inclusion of governance-vote.h
- Replaced magic numbers with their corresponding constant symbols
0a37966 Reordered governance message handling