Commit Graph

44 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
Nathan Marley
1f98bdff06 fix spork setPrivKey (#1051) 2016-09-30 02:19:00 +04:00
UdjinM6
7f687fd696 spork debug log: (#1016)
- add "spork" debug category
- move "seen" and "unknown" to new "spork" debug category to reduce log spam
- new/updated/seen messages should not overlap
2016-09-15 10:50:16 +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
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
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
UdjinM6
5a8c0c9b9d Merge #928: Refactor All The Things - part1
86d8505 Refactor CActiveMasternode
+ move strMasterNodeAddr to CActiveMasternode

a005c79 Refactor InstantSend
+ new lock cs_instantsend to protect maps on CleanTransactionLocksList()
+ new DEFAULT_INSTANTSEND_DEPTH constant
+ rename MIN_INSTANTX_PROTO_VERSION to MIN_INSTANTSEND_PROTO_VERSION and bump it

d24182c Refactor Privatesend
+ decouple from util.h and version.h
+ more functions for CDarksendBroadcastTx: constructors, signing, serialization
+ move from rand() to insecure_rand() in general but to GetRand() for session id
+ fix defaults
2016-08-05 21:49:45 +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
Evan Duffield
6a68aea461 cleanup 2016-04-14 19:54:11 -07:00
UdjinM6
67cd10c87d Add some locks to protect chainActive.Tip() and mapBlockIndex
(fixing only few of them here, see next commit for further changes)
2016-03-04 12:10:37 +03:00
UdjinM6
c676748beb Replace all hardcoded network message strings with NetMsgType:: constants, log unknown commands (net debug category only) 2016-02-19 07:59:00 +03: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
evan82
6bd1d7d16e Merge pull request #532 from UdjinM6/v0.12.0.x_fix_GetSporkValue
fix GetSporkValue
2015-08-15 13:30:21 -07:00
UdjinM6
1289327743 fix GetSporkValue 2015-08-15 16:34:38 +03:00
Evan Duffield
6040fc6f83 fix GetSporkValue return 2015-08-14 12:57:41 -07:00
Evan Duffield
cfe1bdd1e2 fix spork int error 2015-08-14 11:43:28 -07:00
Evan Duffield
bb5570015f Keep track of and reprocess rejected blocks 2015-08-04 18:05:57 -07:00
Evan Duffield
334c3ea971 Added ReprocessBlocks 2015-08-02 16:08:37 -07:00
Evan Duffield
f6721cbe17 Reconsider : typo, use i and break 2015-08-02 15:50:27 -07:00
Evan Duffield
d80feacc8e Reprocess before disconnect for rescan 2015-08-02 14:59:28 -07:00
evan82
718c7f14f9 Merge pull request #384 from UdjinM6/v0.12.0.x_debug_categories
V0.12.0.x additional debug categories
2015-08-01 15:48:03 -07:00
Evan Duffield
44c99417d2 disable block cache / fix reprocess 2015-08-01 01:51:30 -07:00
UdjinM6
dd8fa7c365 Continue work on more debug categories
- rebased to latest v12
- masternode, mnpayments, mnbudget and keepass categories
- remove c_str in logprint(f)
2015-07-31 19:01:18 +03: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
8a5ebeaa62 added spork for reseting budget 2015-07-08 10:25:47 -07:00
UdjinM6
9cfdaffee5 introduce RelayInv 2015-07-08 04:31:10 +03: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
e3963ea71c Spork changes / improvements
- New Command "Spork Active" : Show which sporks report as active
- Cleaned up the spork code and fixed some bugs with defaults
2015-06-25 08:17:53 -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
3cfd9538d5 Merge branch 'master' into merge_btc010 2015-04-10 19:32:57 +03:00
UdjinM6
debcbb75b1 do not search for known sporks by hash, search only by ID 2015-04-07 18:17:50 +03:00
UdjinM6
64eebc3316 0.12 dirty merge'n'fix (bitcoin 0.10) 2015-04-04 19:24:37 +03: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
848adbb2d3 Fixed compiling errors
std::stoi was introduced in C++11, should probably avoid using it
2015-02-26 07:23:06 -07:00
Evan Duffield
662d01733d added spork for resolving forks 2015-02-11 21:21:28 -07:00
Evan Duffield
c8c4cc48f2 fix propagation of spork messages 2015-02-11 13:40:54 -07:00
Evan Duffield
23ea75f737 Add maximum out value for IX via spork 2015-02-11 08:08:55 -07:00
Evan Duffield
db4d5443ac remove debug message 2015-02-09 15:38:16 -07:00
Evan Duffield
6ab868a3e7 added spork files 2015-02-09 13:54:51 -07:00