Commit Graph

61 Commits

Author SHA1 Message Date
UdjinM6
4ccc32615d Linearize and simplify few CMasternode* functions (#1020)
* linearize CMasternodePing::CheckAndUpdate

* simplify CMasternodeMan::CheckAndRemove

* linearize CMasternodeMan::ProcessMessage, DSEG part

* fail fast in CMasternode::Check on spent vin, slightly improve readability
2016-09-15 17:30:51 +04:00
UdjinM6
a3ffedba7c masternode score related fixes (#1019)
* refactor CalculateScore (remove mod, remove extra cs_main lock)

* remove GetCurrentMasternode, use GetNextMasternodeInQueueForPayment instead

* fix masternode rpc "current" (calculate node to pay next block), add rpc "winner" (calculate node to vote for)

* remove "calcscore" rpc
2016-09-15 10:50:41 +04:00
Tim Flynn
906c62e01c Fixes for a number of issues with governance object validation and propagation (#1018)
* 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
2016-09-15 10:49:24 +04:00
UdjinM6
3d9d91ea96 replace magic number with const (MASTERNODES_LAST_PAID_SCAN_BLOCKS) 2016-09-13 02:21:59 +03:00
UdjinM6
57eb2e1842 Update and store collateral block height and block height at which MN was last paid (scan blockchain to find out who actually was paid). Use storage limit instead of mn count to fetch enough data. Calculate new winner using info about block height at which MNs were paid instead of time. 2016-09-12 02:03:59 +03: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
27cba53e64 Merge #941: Simplify CountByIP()
10c249f Simplify CountByIP()
2016-08-12 07:58:55 +02:00
crowning-
072fd72ca3 Merge #930: [UI] IPv4, IPv6 and TOR stats added to Information tab
d07ca0c [UI] IPV4, IPv6 and TOR stats added to Information tab

aaa320e [UI] IPv4, IPv6 and TOR stats added to Information tab
2016-08-06 22:52:01 +02:00
UdjinM6
a4d012069a Merge #920: Slightly refactor FindRandomNotInVec
61e16a3 Slightly refactor FindRandomNotInVec
2016-07-29 07:29:41 +02:00
UdjinM6
4d55bc9666 Cleanup/maintenance (#830)
* remove instance references inside own class

* better logging

* remove unused

* fix tabs/spaces

* bitcoin->dash

* fix README.md
2016-05-30 08:22:30 +02:00
UdjinM6
9745914c15 remove hardcoded strDarksendPoolDummyAddress (#828)
- use "" account address instead
- remove `collateralPubKey` and `SetCollateralAddress()` from darksend and create `dummyScriptPubkey` and `InitDummyScriptPubkey()` in masternodeman instead
- initialize `dummyScriptPubkey` before loading cache otherwise MNs could be removed because of the invalid tx
2016-05-30 08:22:08 +02:00
Evan Duffield
ebaee8f083 moved serialdb to template based class 2016-04-09 23:31:32 -07:00
UdjinM6
54096c30ec Allow user to use 2 modes for masternodebroadcast:
- safe - process mnb as if it was received via network
 - fast - skip most checks and relay
2016-03-18 02:37:48 +03:00
UdjinM6
eaf57b3fb7 Implemented masternodebroadcast
This set of rpc commands provide an ability to create masternode broadcast messages offline
and relay them from online node later (messages expire in ~1 hour).

Arguments:
1. command        (string or set of strings, required) The command to execute
2. passphrase     (string, optional) The wallet passphrase
Available commands:
  create-alias  - Create single remote masternode broadcast message by assigned alias configured in masternode.conf
  create-all    - Create remote masternode broadcast messages for all masternodes configured in masternode.conf
  decode        - Decode masternode broadcast message
  relay         - Relay masternode broadcast message to the network

Closes #741
2016-03-17 08:29:53 +01:00
UdjinM6
a4aef837bd Merge remote-tracking branch 'origin/v0.12.1.x' into mergebtc0.12 + fix 2016-02-16 03:17:25 +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
Evan Duffield
eeb53b9682 Vastly faster syncing process / small budget system changes
- Syncing process is now event based, rather than timeout based. This means the system can tell when it's done with each step and moves on between phases much faster. In initial testing it seems to be about 10-15x faster and has synced everytime successfully.
- Please remove print debugging when the syncing system is proven to be debugged.
2016-02-04 12:29:09 -07:00
Evan Duffield
6b31970f13 Fix payment cycle when network is in the process of updating 2015-08-20 08:37:05 -07:00
UdjinM6
f57c470f95 ask for mn / lower ban score for mnw 2015-08-07 06:07:40 +03:00
UdjinM6
36bb9d6e27 FindRandomNotInVec - should give less failures then FindRandom on doauto 2015-07-30 06:27:29 -07:00
Evan Duffield
145c845d1f Changed vote restrition model
- Masternodes can only vote once per hour now, instead of 100 times a day total
- UI reports back errors now
2015-07-26 07:01:49 -07:00
Evan Duffield
c0a5dfba61 Masternode inv messages / save seen in mncache 2015-07-25 12:07:30 -07:00
Evan Duffield
61745d7724 Filter SigTime modes / version / proto bump 2015-07-24 16:10:44 -07:00
UdjinM6
753297ea99 drop -masternodeminprotocol/nMasternodeMinProtocol, use masternodePayments.GetMinMasternodePaymentsProto() 2015-07-20 08:03:36 +03:00
UdjinM6
dba572ac96 use specific protocols 2015-07-20 04:54:02 +03:00
UdjinM6
26fed43603 Major masternode broadcast/ping changes (incompatible with prev version, proto bump required):
- Do not rely on local lastTimeSeen and requested fRequested anymore. Use last know (signed) ping instead and base all logic on that. Should reduce mn list difference between
 nodes.
- Rework CActiveMasternode accordingly along with states, errorMessages, rpc etc.
- Clean some related code, move parts from public to private
- drop c_str in LogPrintf that were related to this functionality (todo: drop it for LogPrintf everywhere else)
2015-07-14 08:50:30 +03:00
Evan Duffield
c489574e8a Masternode System Bug Fixes
- Fixed a race condition with masternode node selection upon new blocks
- Using nTime for lastpaid instead of the current time for high consensus
2015-06-14 17:05:51 -07:00
Evan Duffield
bd4a7f2fad Masternode payment consensus via quorums
- Payees are chosen by their last payment, if no payment it's based on their hash
- Fixed a few issues with counting quorum votes
2015-05-28 10:45:31 -07:00
Evan Duffield
40149c4e41 Budgeting Software / Reference Node Removal
- Added commands for using budgets "mnbudget" and "mnfinalbudget"
- Supports 100% decentralized budget control and view-only site with json meta data object
2015-05-14 18:01:15 -07:00
Evan Duffield
969826c249 Reference Node / Stubbed Out Budget System
- Removed of reference node and replaced with decentralized quorums that pick the masternodes who get paid each block.
- Made a budgeting system, where masternodes can vote on individual budgets and the data is stored perminently on each clients computer
2015-04-30 07:55:37 -07:00
Evan Duffield
1e69e57662 Masternode Overhaul
- Added new CMasterBroadcast/CmasternodePing objects, with all of the code required to check each new message. SHould be much easier to tell what's going on now.
2015-04-17 23:44:49 -07:00
Evan Duffield
88f6a598b9 Updated Reference-Node Implementation
- Added nLastPaid to masternode information for persistant storage of the masternode payment cycle
- Masternodes get flagged as just paid when they enter the masternode list and must wait a full cycle to be paid again
- Masternode RPC commands now show short vin string instead of ip address
2015-04-16 07:08:06 -07:00
UdjinM6
3cfd9538d5 Merge branch 'master' into merge_btc010 2015-04-10 19:32:57 +03:00
UdjinM6
27514f0f80 masternode stop should disable MN and remove it from MN list 2015-04-08 07:02:23 +03:00
Evan Duffield
631e4b505f fixed vote-many 2015-04-07 12:59:30 -07:00
UdjinM6
64eebc3316 0.12 dirty merge'n'fix (bitcoin 0.10) 2015-04-04 19:24:37 +03:00
UdjinM6
7ae6c961f7 use strMagicMessage to verify mncache.dat, rewrite (only) if hash and both magic are ok 2015-03-24 13:43:14 +03:00
Evan Duffield
dce8718d6b Merge branch 'v11.2-dash' into v0.11.2.x 2015-03-20 07:49:36 -07:00
Evan Duffield
3fff810292 fixed masternode payments FindOldestNotInVec 2015-03-19 08:04:14 -07:00
Evan Duffield
35bb210c6b Dash rebranding 2015-03-17 16:06:58 -07:00
Evan Duffield
8cd7f8e980 Add structure for donating a percentage of ones earnings to another party via the protocol 2015-03-16 12:01:11 -07:00
Evan Duffield
819724ad1d merged proof-of-service 2015-03-16 09:40:39 -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
UdjinM6
6933d17a80 - new function GetMasternodeRanks returns full masternode rank list
- use GetMasternodeRanks in "masternode list rank" instead of GetMasternodeRank
- small cleanup
2015-03-14 21:37:43 +03:00
UdjinM6
b5414e1c3c save nDsqCount in mncache.dat 2015-03-06 20:59:19 +03:00
UdjinM6
e522cbfd6a rename masternodes.dat->mncache.dat / fix strings 2015-03-05 20:39:47 +03:00
Evan Duffield
f63e1ddfd0 Merge branch 'v-1.11.2.x' of https://github.com/darkcoinproject/darkcoin into v0.11.2.x 2015-03-05 08:23:43 -07:00
Mike Kinney
98fe439af4 V0.11.2.x update comments 2015-03-05 00:10:15 -08:00
UdjinM6
2a5d588784 Make masternodes.dat verification more specific, prevent from overwriting corruped files and files with unknown format, give more info in debug.log output 2015-03-05 02:46:50 +03:00
Evan Duffield
a6b58ab1e8 Merged masternode blinding 2015-03-04 08:58:36 -07:00