Commit Graph

13293 Commits

Author SHA1 Message Date
Tim Flynn
a31e0cadec Set mainnet superblock cycle to monthly 2016-09-11 14:01:26 -04:00
UdjinM6
08f8300985 Remove deprecated masternode sync members 2016-09-11 21:00:45 +03:00
Nathan Marley
b31ee8441a restore vote-many (#1003) 2016-09-11 21:58:17 +04:00
UdjinM6
84ac8de59d Wallet passphrase lock fixes (#987)
* Wallet passphrase lock fixes:
- wallet should not allow cli commands to bypass lock validation
- wallet should lock again in mixing mode if it was unlocked for mixing and next unlock (e.g. for sending funds) happened
- removed AnonymizeOnlyUnlocked status, it's never going to be reached anymore
- "For anonymization only" checkbox:
  - should be available only when user click "Start Mixing"
  - should be set on by default when available
  - adjusted title
- adjust error messages in walletpassphrase for unlocked wallets

* Add comment about IsLocked() usage

* Final safety check for locked wallet in WalletModel::prepareTransaction
2016-09-11 13:02:54 +04:00
Tim Flynn
d81e729b0a Governance bug fix (#998)
* 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
2016-09-09 19:52:10 +04:00
Tim Flynn
740d1e0b1e Push out mainnet superblock start, in case people run 12.1 on mainnet (#999) 2016-09-09 19:51:46 +04:00
UdjinM6
b7e81cb2bd Decouple mn payments from version.h, drop MIN_MNW_PEER_PROTO_VERSION (#960)
* Decouple min mnw versions from version.h, drop MIN_MNW_PEER_PROTO_VERSION in fav of GetMinMasternodePaymentsProto()

* Split min protocol validation for new and old winners in IsValid
2016-09-08 16:04:45 +04:00
Tim Flynn
f76f6fbb8e Governance Fixes/Refactoring Pack (#995)
* 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
2016-09-08 15:40:19 +04:00
Holger Schinzel
9738a238fa Merge #997: update testnet checkpoint
696d8f4 update testnet checkpoint
2016-09-08 13:33:29 +02:00
crowning-
a6a0f75614 Merge #982: [RPC] new command 'getsuperblockheight'
1080018 [RPC] new command 'getsuperblockheight' to return the last/next superblock height
2436067 [RPC] new command 'getsuperblockheight' [update 1]
753e00d [RPC] new command 'getsuperblockheight' [update 2]
1ec9289 [RPC] new command 'getsuperblockheight' [update 2]
dbac6e6 [RPC] new command 'getsuperblockheight' [update 3]
e1b7b15 [RPC] new command 'getsuperblockheight' [obsolete include removed]
ee85293 Code review results changes
2016-09-08 13:33:25 +02:00
Tim Flynn
5e564e17d3 Bug fixes for the governance rpc interface (#993)
* 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.
2016-09-07 16:02:24 +04:00
UdjinM6
36c4b6dc2e Trivial refactoring/cleanup (#990) 2016-09-05 20:09:25 +04:00
Tim Flynn
8c09a459b1 V0.12.1.x governance fees pr (#988)
* 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
2016-09-05 03:44:10 +04:00
UdjinM6
ad4f1dc245 Refactor TransactionDesc::FormatTxStatus (#985)
Should be much easier to read code and to translate strings now.
2016-09-04 05:48:37 +04:00
UdjinM6
126be6fcf9 Slightly refactor masternode list tab, update list of "my" node after start was clicked (#979) 2016-09-04 05:48:23 +04:00
UdjinM6
199bbf5071 Refactor SendDarksendDenominate, split it into 2 decoupled steps. (#976)
As a client, submit part of a future mixing transaction to a Masternode to start the process (SubmitDenominate):
step 1: prepare denominated inputs and outputs (PrepareDenominate, code moved from wallet.cpp, slightly refactored)
step 2: send denominated inputs and outputs (SendDenominate, slightly refactored)
2016-09-02 16:19:29 +04:00
UdjinM6
b40c3e5927 Use Dash addresses in rpc examples (#986) 2016-09-02 16:17:58 +04:00
UdjinM6
46744394a2 More instantx->instantsend (few more ds->privatesend) (#984) 2016-09-02 16:17:32 +04:00
Tim Flynn
851b49aba0 Report amounts in the correct currency (#983) 2016-09-02 01:02:45 +04:00
UdjinM6
0597900c16 Changes for sporks: (#981)
- rename all 3 instantsend sporks
- remove SPORK_7_MASTERNODE_SCANNING (not used anymore)
- change `_DEFAULT` for spork 2 and 3, adjust comments for for them
- fix GetSporkNameByID() (should not return smth_DEFAULT)
2016-09-01 18:55:25 +04:00
UdjinM6
e8ec9a6e06 Trivial: more darksend -> privatesend (#980) 2016-09-01 11:03:47 +04:00
UdjinM6
d48fe533d6 Merge #973: Change log output for CDarksendQueue
def2a7d Change log output for CDarksendQueue
2016-08-29 21:17:00 +02:00
UdjinM6
0cf75d0ef7 Merge #974: Slightly refactor sporks
6648716 Slightly refactor sporks, rename spork9 to SPORK_9_SUPERBLOCKS_ENABLED, remove SPORK_11_RESET_BUDGET (not used anymore)
2016-08-29 21:16:02 +02:00
UdjinM6
bf335ddfb3 Merge #972: Refactor CDarkSendEntry
6debbe6 Refactor CDarkSendEntry
- make it serializable, use constructor, pass objects of CDarkSendEntry type to functions (instead of separate variables
2016-08-29 21:14:34 +02:00
UdjinM6
bc80d7e2a5 Merge #969: Masternode sync improvements
da406e3 Masternode sync improvements
    - add simple helpers for few more sync states (use them where appropriate instead of old code + rpc output)
    - use new helpers to avoid meaningless message processing
    - actually fail if sync shouldn't continue due to lack of info, make sure Reset is used to quit failed state
2016-08-29 21:11:34 +02:00
Tim Flynn
b68e119e4d Changed testnet parameters to activate superblocks for 12.1 with sentinel. (#971)
- Note that this is expected to fork testnet around block 60000
2016-08-29 03:22:25 +04:00
Tim Flynn
35e857a5ca V0.12.1.x sentinel pr 2 (#970)
* Improve JSON error reporting in CGovernanceObject::LoadData

* Changed JSON parsing to match current version of sentinel which now sends
correct JSON integers instead of quoting them as strings
2016-08-29 02:08:27 +04:00
Tim Flynn
0c65204ee6 Merge #967: V0.12.1.x sentinel pr 1 (#967)
d371930 Added nMinGivernanceQuorum chain parameter

6e24c9c Replace hardcoded minimum with nMinGovernanceQuorum parameter

66c0d9e Added new RPC calls needed by Sentinel
 - getsuperblockcycle
 - getsuperblockbudget
 - getmingovernancequorum

6bb2338 Replaced two new RPC calls with getgovernanceinfo

c9fbd8a Changed parameter nMinGovernanceQuorum to nGovernanceMinQuorum
2016-08-28 13:15:48 -06:00
UdjinM6
7b10f9aaa6 Refactor CMasternodeSync (#956) 2016-08-28 14:12:14 +04:00
UdjinM6
f678ea48bd Update checkpoints to match latest 0.12.0.x (#962) 2016-08-28 14:11:54 +04:00
UdjinM6
02b86cf467 Make 0.12.1.x minable again (#963)
* Changes for getblocktemplate, CreateNewBlock, FillBlockPayee, CreateSuperblock:
- Add support for superblocks in getblocktemplate (+fix miner reward - it was missing)
- Refactor the way masternode payments are passed around, change getblocktemplate format for them too.
2016-08-28 14:11:36 +04:00
UdjinM6
790607b060 Fix wallet.py iand util.py after merging bitcoin 0.12 2016-08-26 13:42:52 +03:00
UdjinM6
6af7a58d92 Merge remote-tracking branch 'bitcoin/0.12' into mergebtc12, fix/dashify
NOTE: .travis.yml was mostly preserved, probably needs additional attention
2016-08-26 04:09:20 +03:00
TheLazieR Yip
180a81eada Fix typos in protocol-documentation.md (#964)
CMastenrodePing -> CMasternodePing
2016-08-24 21:09:08 +04:00
UdjinM6
c04e14fa61 Merge #958: test: fix determinism of address index test
5765e5f cherry-pick 05cf410839dd48882768412d2637b53e6569a677
2016-08-23 05:27:52 -06:00
UdjinM6
83f4e57087 Merge #957: Refactor CKeePassIntegrator
d4f5d7c Refactor CKeePassIntegrator
2016-08-23 05:27:04 -06:00
UdjinM6
a1d2c938de Merge #953: Streamline GetBlockSubsidy()
2339409 Streamline GetBlockSubsidy()
2016-08-23 05:25:03 -06:00
UdjinM6
3b606b0c63 Merge #951: More block validation for governance (#951)
b6b6d6c Added nSuperblockStartBlock, adjusted testnet/regtest params

15a3c64 More for governance block checks, p1 (non-compilable):
    - add GetPaymentsLimit() and GetPaymentsTotalAmount()
    - IsValidBlockHeight() should check nSuperblockStartBlock
    - CSuperblock::IsValid should check payment limit and miner payout
    - no cs_main
    - slightly refactored related things

e8f9e5d More for governance checks, p2 (compilable):
    - IsBlockValueValid(), IsBlockPayeeValid() and FillBlockPayee() rewritten, no cs_main for them
    - CreateNewBlock adjusted, need more work on CBlockTemplate (see TODO)
    - moved (and simplified) IsBlockPayeeValid() call from CheckBlock() to ConnectBlock()

51434cf Add ability to calculate only superblock part of subsidy in GetBlockSubsidy()

aa74200 Fix GetPaymentsLimit()

f7b6234 braces and comment

ade8f64 more checks for IsValidBlockHeight()
2016-08-21 19:41:40 -06:00
Tim Flynn
9a8f2e4507 V0.12.1.x governance bugfix 1 (#952)
* Fix governance message handling bug

* Added a 2 second delay to the addressindex blockchain reorganization test
2016-08-20 20:51:01 +04:00
Tim Flynn
123aa04d5b Merge #950: V0.12.1.x governance pr 2
13316a4 Return true from IsBlockValueValid when masternode data is not synced
  - This restores behavior very close to that in 12.0
  - Needed to prevent the forking problem currently being seen on
    testnet between online and offline nodes
  - This is expected to be a temporary fix while we develop a
    long-term solution for this problem

427086e Restore miner payments for superblocks

794b90d Added IsSynced field to JSON output of mnsync status RPC command
  - This is needed to allow fixing RPC tests so that they wait until
    the nodes are fully synced before performing tests

a9ddf6f Wait for nodes to sync masternode data during p2p-fullblocktest
2016-08-19 05:53:49 -06:00
Tim Flynn
c05231c2a7 Merge #949: Added EXTRACT_STATIC = YES to Doxyfile
86e861c Added EXTRACT_STATIC = YES to Doxyfile so we can get call graphs for the static functions in main.cpp
2016-08-19 05:52:04 -06:00
UdjinM6
67def9ef2e Merge #948 Refactor CDarkSendSigner
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
2016-08-19 05:50:04 -06:00
UdjinM6
66de5b082a Merge #946: Fix extra warning about low keys on wallet encryption
5d62e4f Fix extra warning about low keys on wallet encryption
2016-08-19 05:47:37 -06:00
UdjinM6
7d55e623a8 Merge #945: More dash->dashcore
a5328a1 Change Dash -> Dash Core where appropriate (in strings)

b8696d9 Change user/group dash->dashcore

69dc9f1 Change dash->dashcore for /etc/ and /var/lib/ folders
2016-08-19 05:46:30 -06:00
crowning-
1ecabea8a6 CDB: fix debug output (#947)
* CDB: fix debug output
2016-08-18 18:23:39 +04:00
Tim Flynn
de7b2b6c51 Merge #944: V0.12.1.x governance pr - part 1 - base functionality
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
2016-08-17 09:08:25 +02:00
Tim Flynn
9a8a1ace9e Merge #943: Fixed non-deterministic CSporkMessage hash function
5bb8dca Fixed non-deterministic CSporkMessage hash function

CSporkMessage::GetHash() was including random data
in the hash due to 4 bytes of structure padding between the 32 bit
nSporkID and the following 64 bit nValue members.

This has been fixed by using CHashWriter which serializes the structure
data properly before hashing rather than relying on compiler defined behavior
such as structure alignment.  The underlying hash function is CHash256 which is
bitcoin's double SHA-256 hash.  HashX11 is not necessary here
because the hash is only used to identify distinct spork messages.
2016-08-15 16:46:46 +02:00
UdjinM6
a31e7600e9 Merge #942: Leave some space for free transactions by defaut (10000)
857eaee Leave some space for free transactions by defaut (10000)
2016-08-12 08:01:14 +02:00
UdjinM6
27cba53e64 Merge #941: Simplify CountByIP()
10c249f Simplify CountByIP()
2016-08-12 07:58:55 +02:00
UdjinM6
df854a5e19 Merge #940: Adjust block download timeouts to match Dash avg block time (bitcoin/4)
9320e5b Adjust block download timeouts to match Dash avg block time (bitcoin/4)
2016-08-12 07:57:20 +02:00