Commit Graph

79 Commits

Author SHA1 Message Date
Holger Schinzel
e1702cd4ec bump copyright notice to 2017 (#1207) 2016-12-20 17:26:45 +04:00
UdjinM6
072b0fd708 fix annoying compiler warnings (#1204) 2016-12-14 17:33:46 +04:00
Tim Flynn
3e8c0062a0 Implement SPORK_14_REQUIRE_SENTINEL (#1163) 2016-11-23 19:30:36 +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
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
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
d514ee7f9a Merge #922: Refactor/fix spork
42bdf42 Refactor/fix spork:
- move ProcessSpork, GetSporkValue, IsSporkActive, ExecuteSpork and mapSporksActive to CSporkManager
- move Sign, CheckSignature, Relay to CSporkMessage
- move ReprocessBlocks out of sporks to main.cpp / rename DisconnectBlocksAndReprocess to DisconnectBlocks
- rename SporkKey to SporkPubKey
- bugfix: only set strMasterPrivKey if spork signature produced by that key was verified successfully
- few log format changes, cleaned up includes
2016-07-30 13:04:27 +02:00
UdjinM6
a5ac60b868 Merge remote-tracking branch 'bitcoin/0.12' into HEAD
+ merge fixes
+ keepass on evhttp
2016-02-06 16:48:04 +03:00
Evan Duffield
6040fc6f83 fix GetSporkValue return 2015-08-14 12:57:41 -07:00
Evan Duffield
1d54f4127b disable superblock spork 2015-08-09 10:49:14 -07:00
UdjinM6
b743112d57 bump time for sporks 8-10 to be off by default 2015-08-09 03:27:38 +03:00
Evan Duffield
334c3ea971 Added ReprocessBlocks 2015-08-02 16:08:37 -07:00
Evan Duffield
ef1dc8434e Prepare testnet for upgrade 2015-08-02 07:28:38 -07:00
Evan Duffield
e03879b3cf Update spork name : SPORK_10_MASTERNODE_PAY_UPDATED_NODES 2015-07-27 08:28:10 -07:00
Evan Duffield
7101c951f8 Budget Improvements
- Client bump
- Improved syncing logic (sholud stop hanging issues)
- New spork for turning on super blocks
- Fixed issue with sending old/invalid finalized budgets
- Fixed issue with syncing clients and lack of confirmations with budget items (for IX)
2015-07-16 20:03:42 -07:00
Evan Duffield
e5f37b8c98 New Spork : Reconsider X Blocks
- This allows us to fix forks remotely without anyone having to reindex. It remains trustless, because all nodes will simply find the longest chain.
2015-07-16 11:06:45 -07:00
Evan Duffield
640e721487 fixed spork show 2015-07-11 16:17:03 -07:00
Evan Duffield
8a5ebeaa62 added spork for reseting budget 2015-07-08 10:25:47 -07:00
Evan Duffield
a351456c17 Fixed invalid saved budget.dat issue 2015-07-08 10:17:16 -07:00
Evan Duffield
2b75faefee Various fixes improvements
- Implemented spork for only paying new nodes after a period of time on mainnet
- protocol bump
- fixed a few issues with sporks. Spork show now shows all sporks, instead of the changed ones. IsSporkActive now supports sporks set to 0 as on.
2015-06-25 12:59:11 -07:00
Evan Duffield
eaf7b940a6 Complete rewrite of consensus code for mn/budget payments
- Added FindProposal and FindFinalBudget to budgeting class
- Added 2 new sporks for Proposals and Budget payment enforcement. This is outside of the decentralized code so we can turn it off if there's a problem.
- Detect budget blocks and pay correct amounts in super blocks
2015-05-30 10:27:51 -07:00
UdjinM6
64eebc3316 0.12 dirty merge'n'fix (bitcoin 0.10) 2015-04-04 19:24:37 +03:00
Evan Duffield
35bb210c6b Dash rebranding 2015-03-17 16:06:58 -07:00
Evan Duffield
e5267319ef Complete implementation of Proof-of-Service
- Ensures ports remain open and client are responsive to IX requests.
- Completely 100% decentralized. This farms out the work of checking the masternode network to the masternode network. 1% of the network is determistically selected to check another 1% of the network each block. It takes six separate checks to deactivate a node, thus making it tamper proof.
- Nodes are kept in the masternode list if they fail enough PoSe checks to deactivate. They will continue to be checked until the operator fixes them. However they will not be paid while they're failing checks.
2015-03-16 09:32:18 -07:00
Evan Duffield
662d01733d added spork for resolving forks 2015-02-11 21:21:28 -07:00
Evan Duffield
23ea75f737 Add maximum out value for IX via spork 2015-02-11 08:08:55 -07:00
Evan Duffield
c7206802e4 fixed attribution 2015-02-09 14:06:11 -07:00
Evan Duffield
6ab868a3e7 added spork files 2015-02-09 13:54:51 -07:00