Commit Graph

15176 Commits

Author SHA1 Message Date
UdjinM6
737353c84c
Fix IsBlockValueValid/IsOldBudgetBlockValueValid (#2276) 2018-09-10 17:12:32 +03:00
Alexander Block
c3d6b06518 Remove redundant check for unknown commands in masternode RPC (#2279) 2018-09-10 13:23:42 +03:00
thephez
ad6c2893c0 Docs - Update Core version number in readme files (#2267) 2018-09-10 13:23:22 +03:00
UdjinM6
1560b16775
Merge pull request #2264 from codablock/pr_dip3_unittests
DIP3 and DIP4 unit tests
2018-09-06 01:50:45 +03:00
Alexander Block
bc7924d418 Add unit tests for DIP3 and DIP4 2018-09-05 18:40:53 +02:00
Alexander Block
d653ace99e Update CbTx in TestChainSetup
We need to update the CbTx's merkle root for the masternode list here as
tests might add transactions into a block which cause the list to change.
2018-09-05 18:40:53 +02:00
Alexander Block
9674be8f96 Refactor TestChain100Setup to allow different test chain setups
Allows testing of features which depend on BIP9 deployments
2018-09-05 18:40:53 +02:00
UdjinM6
ad31dbbd73
Add more variance to coin selection in PS mixing (#2261)
* Lean towards "from high to low" branch but still mix via "from low to high" one someties

* Try to mix non-duplicate txids only

* Lean towards edges but still mix starting from the middle sometimes

If failed when started from the middle try mixing from the edges right away.

Note: liqudity providers always start from 0

* map -> set

* Refactor nRoundStart calculations
2018-09-05 19:35:33 +03:00
Alexander Block
cb37c39725 Bump PROTOCOL_VERSION to 70211, bump MIN_* protocols to 70210 (#2256)
Bump PROTOCOL_VERSION to 70211, bump MIN_* protocols to 70210
2018-09-05 19:34:56 +03:00
UdjinM6
f0166389bd
Merge pull request #2258 from codablock/pr_dip3_paymentlogic
DIP3 MN reward payment logic
2018-09-05 15:08:53 +03:00
Alexander Block
d8247dfffa Use refactored payment logic when spork15 is active
Related to https://github.com/dashpay/dash/pull/2237
2018-09-05 14:06:50 +02:00
Alexander Block
60002b7ddb Payout and enforce operator reward payments 2018-09-05 14:06:50 +02:00
Alexander Block
2c481f0f86 Implement deterministic version of CMasternodePayments::IsScheduled
Needed for privatesend when choosing masternodes
2018-09-05 14:06:50 +02:00
Alexander Block
44706dc88a Implement projection of MN reward winners in "masternode winners" 2018-09-05 14:06:50 +02:00
Alexander Block
e6b699bc26 Enforce MN and superblock payments in same block
1. Enforce payment to masternodes in IsBlockPayeeValid even if superblocks
   are triggered. This new rule only gets activated when spork15 activates.

2. Always enforce masternode payments when spork15 is activated and ignore
   spork8 in that case. spork8 can be removed after spork15 activation
   and hardening of the spork15 height into consensus params.
2018-09-05 14:06:31 +02:00
Alexander Block
19fbf8ab76 Move cs_main lock from CMasternode::UpdateLastPaid to CMasternodeMan
Ensure correct locking order to fix deadlock.
2018-09-05 14:06:31 +02:00
Alexander Block
dc7292afa9 Implement new MN payments logic and add compatibility code 2018-09-05 14:06:31 +02:00
PastaPastaPasta
b99886532e add link for developer-notes in contributing (#2260) 2018-09-05 15:05:27 +03:00
PastaPastaPasta
fded838c9d RPC folder: Cleaned up brackets on if, while, for, BOOST_FOREACH. Some whitespace fixes (#2257)
* Cleaned up brackets on if, while, for, BOOST_FOREACH. Some whitespace fixes

* gov, mn and mining cleanup

* Revert "Cleaned up brackets on if, while, for, BOOST_FOREACH. Some whitespace fixes"

This reverts commit 4a2a1b0645c5195025d0c7e6dad2e01a93efbfd6.

* Revert "gov, mn and mining cleanup"

This reverts commit 7cb91aabc67df0ab60db4ee84e3aaaf6cf6b7881.

* cleanup some dash specific

* "if(" -> "if ("     "for(" -> "for (" + corrected some else blocks
2018-09-05 15:04:24 +03:00
UdjinM6
8c9cb29092
Revert 2075 (#2259)
* Revert "Require all participants to submit equal number of inputs (#2075)"

This reverts commit 7ac4b972ab.

* Backward compatibility for nInputCount
2018-09-05 14:19:03 +03:00
UdjinM6
b164bcc7a5
Split PS into Manager and Session and allow running multiple mixing sessions in parallel (client side) (#2203)
* Split PS into Manager and Session

* Adjust log messages accordingly

* add -privatesendsessions cmd-line option

* address review comments

* bump MAX_OUTBOUND_MASTERNODE_CONNECTIONS to 30

+10 for parallel mixing

* protect vecSessions

* constructors

* Rewrite CMasternodeMan::ProcessMasternodeConnections() to use CPrivateSendClientManager::GetMixingMasternodesInfo().

This should solve potential deadlock cs_vecqueue vs cs_vNodes.

* Drop no longer used IsMixingMasternode()

* lock cs_wallet when mixing uses balance related functions
2018-09-04 13:54:59 +03:00
UdjinM6
794921b7b5
Merge pull request #2255 from codablock/pr_dip3_logic
DIP3 compatibility code
2018-09-03 22:05:34 +03:00
Alexander Block
d4530eb7d5 Put all masternodes in MASTERNODE_ENABLED state when spork15 is active 2018-09-03 13:31:40 +02:00
Alexander Block
31b4f83543 Forbid starting of legacy masternodes with non matching ProTx collateral values
If the masternode is already upgraded to ProTx, it's address and key
must match with the started masternode.
2018-09-03 13:31:40 +02:00
Alexander Block
2d8f1244cf Implement 'masternode info <proTxHash>' RPC 2018-09-03 13:31:40 +02:00
Alexander Block
e2a9dbbce1 Better "masternode status" for deterministic masternodes 2018-09-03 13:31:40 +02:00
Alexander Block
50ac6fb3aa Throw exception when trying to invoke start-xxx RPC in deterministic mode 2018-09-03 13:31:40 +02:00
Alexander Block
5050a92053 Add compatibility code for FindRandomNotInVec and GetMasternodeScores 2018-09-03 13:31:40 +02:00
Alexander Block
cc73422f88 Add methods to add/remove (non-)deterministic MNs 2018-09-03 13:31:40 +02:00
Alexander Block
7d14566bcd Add compatibility code to CMasternodeMan so that old code is still compatible
...when deterministic MNs are activated.
2018-09-03 13:31:40 +02:00
Alexander Block
27e8b48a60 Stop executing legacy MN list code when spork 15 is activated 2018-09-03 13:31:40 +02:00
Alexander Block
6764dafece Skip initial masternode list sync if spork 15 is active 2018-09-03 13:31:40 +02:00
Alexander Block
d90b139967 Implement CActiveDeterministicMasternodeManager 2018-09-03 13:31:40 +02:00
UdjinM6
a5e65aa373
Erase mnListCache entry on UndoBlock (#2254) 2018-09-03 13:18:20 +03:00
Alexander Block
88e7888de9 Try using cache in GetListForBlock before reading from disk (#2253)
* Try using cache in GetListForBlock before reading from disk

* Use std::list for vecDiff
2018-09-03 13:17:41 +03:00
UdjinM6
2900760dac
Merge pull request #2251 from codablock/pr_dip4
DIP4 implementation
2018-09-03 13:16:52 +03:00
Alexander Block
fced9a4b86 Ban peers that send us MNLISTDIFF messages
These are only meant to be sent to SPV clients
2018-09-03 10:46:52 +02:00
Alexander Block
c7f75afdd6 Fix nulldummy tests by creating correct DIP4 coinbase transactions 2018-09-03 10:46:52 +02:00
Alexander Block
d3ac86206c Implement GETMNLISTDIFF and MNLISTDIFF P2P messages
Also add "protx diff" RPC
2018-09-03 10:46:52 +02:00
Alexander Block
bcc0719578 Calculate and enforce DIP4 masternodes merkle root in CbTx
Also add "coinbase_payload" field to block templates
2018-09-03 10:46:51 +02:00
Alexander Block
0a086898f5 Implement and enforce CbTx with correct block height and deprecate BIP34 2018-09-03 10:46:40 +02:00
UdjinM6
11df4f24de
Merge pull request #2250 from codablock/pr_dip3_othertxs
Implementation of remaining DIP3 special transactions
2018-08-31 18:20:26 +03:00
Alexander Block
58aa813649 Implement "protx revoke" RPC 2018-08-31 17:06:33 +02:00
Alexander Block
9653af2f30 Classes, validation and update logic for CProUpRevTX 2018-08-31 17:06:33 +02:00
Alexander Block
185416b970 Implement "protx update_registrar" RPC 2018-08-31 17:06:24 +02:00
Alexander Block
1c68d11077 Classes, validation and update logic for CProUpRegTX 2018-08-31 17:06:24 +02:00
Alexander Block
32951f795c Implement "protx update_service" RPC 2018-08-31 17:06:24 +02:00
Alexander Block
8aca3b0404 Also check duplicate addresses for CProUpServTX in CTxMemPool 2018-08-31 17:06:24 +02:00
Alexander Block
923fd67395 Implement CProUpServTx logic in CDeterministicMNManager 2018-08-31 17:06:24 +02:00
Alexander Block
6ec0d7aea5 Classes and basic validation of ProUpServTx 2018-08-31 17:06:24 +02:00