Commit Graph

114 Commits

Author SHA1 Message Date
UdjinM6
9ab4a72454 cleanups/fixes:
- use map.insert instead of [] (should be safer)
- debug output / comments / spaces / names
- fix few long strings / make translatable one more label in UI
2015-07-30 19:12:05 +03:00
UdjinM6
afd715286a fix all kind of lock issues 2015-07-30 16:44:18 +03: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
b04faf6e2d Update lastPing in mapSeen obj, remove ping from CMasternode hash 2015-07-25 21:13:17 -07:00
Evan Duffield
c0a5dfba61 Masternode inv messages / save seen in mncache 2015-07-25 12:07:30 -07:00
Evan Duffield
5281c48f70 Fix syncing issues
- if(pindexPrev->nHeight + 4 < pindexBestHeader->nHeight || pindexPrev->nTime + 600 < GetTime()) return;
-- && allowed skipping in various situations, which caused blocks to be rejected because of lack of mnfinalbudget data
2015-07-24 09:10:08 -07:00
Evan Duffield
9e65749ff6 Safer calcscore implementation 2015-07-24 08:50:10 -07:00
Evan Duffield
388f22c576 Version 26 / New masternode consensus system
- Consensus system selects 1/10 of the oldest masternodes by payment, then selects payee by score from those. This fixes various race conditions when blocks are close together or inconsistant historical winner lists.
- Ask for up to 2 cycles of history
- Keep up to 5 cycles of history locally
2015-07-21 20:07:23 -07:00
Evan Duffield
cbe2bae130 Improved lastpaid and fixed votes calculation 2015-07-21 16:57:21 -07:00
Evan Duffield
b2c4e14ee8 Add offset for lastpaid / seperate min mnw peer version 2015-07-21 16:11:49 -07:00
Evan Duffield
e4a0e8340c Masternode payment cache and mnget changes
- Cache saves masternode payment history
- On startup, the client will find the most recent block and calculate the amount of entries to ask for. The other peer will then send that amount of entries to save bandwidth on restarts.
2015-07-20 19:24:43 -07:00
Evan Duffield
37f55a3181 Refactored masternode payments system
- Replaced coinbase cache in favor of using the masternode payments voting system only
- Syncing masternode payments now supports up to the syncing the entire payment list
2015-07-20 15:09:42 -07:00
Evan Duffield
2d745eb539 Don't sync sporks in regtest, fix segfault
- segfault caused by:
-    fRequireEnabled = (fRequireEnabled && pmn->IsEnabled()) || !fRequireEnabled;
-    if(pmn != NULL && fRequireEnabled && pmn->protocolVersion >= masternodePayments.GetMinMasternodePaymentsProto())
2015-07-20 11:56:02 -07:00
Evan Duffield
f36e4251ab mnb/mnp debugging 2015-07-20 11:43:10 -07:00
UdjinM6
cc26cff893 do not require active MN on ping check from UpdateFromNewBroadcast 2015-07-20 20:46:22 +03:00
UdjinM6
753297ea99 drop -masternodeminprotocol/nMasternodeMinProtocol, use masternodePayments.GetMinMasternodePaymentsProto() 2015-07-20 08:03:36 +03:00
UdjinM6
86c869137f fixes for sync 2015-07-20 04:54:02 +03:00
UdjinM6
dba572ac96 use specific protocols 2015-07-20 04:54:02 +03:00
Evan Duffield
9c34930680 Disable nDos on early ping / sync regtest changes 2015-07-19 08:49:46 -07: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
UdjinM6
9cfdaffee5 introduce RelayInv 2015-07-08 04:31:10 +03:00
UdjinM6
189e48328d fix 2 crashes 2015-07-03 01:56:43 +03:00
Evan Duffield
f1b868f098 Removed PoSe due to consensus issues
- With nodes coming and going on the network, the network could come to different opinions about who should get paid next in line due to some nodes being flagged as failing a PoSe check. This will have to be fixed by introducing a blockchain based PoSe system, but that's out of the scope of this release. To fix the issues in the interrim, I'm removing PoSe checks for the time being.
2015-06-23 16:44:31 -07:00
Evan Duffield
3c01ffa444 fixed errors from merge 2015-06-23 10:59:14 -07:00
Evan Duffield
43e6976695 merged 2015-06-23 10:53:12 -07:00
Evan Duffield
c72355335c Coinbase Payee Cache Implementation
- Masternode nLastPaid is removed and a new caching system that keeps the last 30 days of coinbase payees replaces it
- To deal with some significant attack vectors, the masternode donation feature was removed. The donation feature was added to support developement anyway, so this will be replaced by the budgeting code.
-  This code should allow the network to come to consensus about who should be paid pretty effectively
2015-06-23 10:48:03 -07:00
UdjinM6
a6a04cb5c1 refactor: dsee -> mnb 2015-06-23 18:40:08 +03:00
Evan Duffield
947b79c8c5 Changed masternode broadcast/pinging logic
- Fixed a bug causing the broadcasts to be ignored in some situations
- Added some logic to rebroadcast new masternodes, so the rest of the network finds out about unknown nodes quickly
- should help masternode payments to work properly
2015-06-20 12:56:56 -07:00
UdjinM6
1e393d5b70 fix mnping 2015-06-18 21:41:01 +03:00
UdjinM6
91c7f66562 remove nLastPaid from CMasternodeBroadcast 2015-06-18 00:18:24 +03:00
UdjinM6
795ee119ec SecondsSincePayment (fix buffer overflow / change logic / move impl to cpp) 2015-06-17 23:03:09 +03:00
UdjinM6
19d9a65f8a add recent (tip - 12) block hash to mnping 2015-06-09 14:37:36 +03: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
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
d25cf1af22 Split masternode and payments code 2015-04-16 13:26:18 -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
62bbc1176e fix merge 2015-04-10 20:08:01 +03:00
UdjinM6
3cfd9538d5 Merge branch 'master' into merge_btc010 2015-04-10 19:32:57 +03:00
Evan Duffield
91a669e231 Ref-node : Always fill vecLastPayments
- In some rare cases the vecLastPayments would get truncated and would start paying people it paid recently again. This stops that from happening.
2015-04-09 10:06:48 -07:00
UdjinM6
41f592aec7 Explicitly convert mutable txes to immutable before calling AcceptableInputs 2015-04-07 05:59:56 +03:00
UdjinM6
dd39898a6b Merge branch 'master' into HEAD
Resolved conflicts:
	configure.ac
	src/clientversion.h
	src/qt/locale/dash_bg.ts
	src/qt/locale/dash_cmn.ts
	src/qt/locale/dash_de.ts
	src/qt/locale/dash_es.ts
	src/qt/locale/dash_fi.ts
	src/qt/locale/dash_pt.ts
	src/qt/locale/dash_ru.ts
	src/qt/locale/dash_sv.ts
	src/qt/locale/dash_vi.ts
	src/qt/res/icons/toolbar.png
	src/qt/res/icons/toolbar_testnet.png
2015-04-04 19:45:02 +03:00
UdjinM6
64eebc3316 0.12 dirty merge'n'fix (bitcoin 0.10) 2015-04-04 19:24:37 +03:00
Evan Duffield
fea26cfb89 updated minimum for reference node 2015-03-30 12:33:42 -07:00
Evan Duffield
b89fd2e149 compiling warnings / fixed block comparison 2015-03-26 14:11:05 -07:00
Evan Duffield
a34ca7a88c Reference node fixes / debugging
- Only allow payments to be created once per blockHeight
2015-03-26 13:46:19 -07:00
Evan Duffield
6c9cc68449 version 12 2015-03-26 07:29:56 -07:00
UdjinM6
5c1621447d make sure nScanningErrorCount and nLastScanningErrorBlockHeight handled correctly 2015-03-24 04:52:27 +03:00
UdjinM6
2a7c348b16 explicitly grab each piece of data from memory for hashing in CMasternode::CalculateScore 2015-03-23 20:28:36 +03:00
Evan Duffield
4592b5090d fixed masternode donation miscalculations 2015-03-23 07:13:20 -07:00