Commit Graph

13172 Commits

Author SHA1 Message Date
UdjinM6
6d9e414c6a Split CheckAndUpdate: (#1175)
- SimpleCheck - to verify only future time and unknown blockhash
- CheckAndUpdate - to verify everything
2016-11-30 23:32:36 +04:00
UdjinM6
15cf414967 Slightly improve/cleanup log output (#1174) 2016-11-30 05:33:47 +04:00
UdjinM6
17cebbed15 fix excessive banning, remove some redundant logic (#1172)
* Since we send all mnb's now regardless of mn state, ping check for sigTime being too old is obsolete (and wrong).
Also removing fRequireEnabled, this logic is deprecated too it seems.

* remove (pre-)enabled check in CMasternodeMan::Add
2016-11-30 05:33:37 +04:00
UdjinM6
6cd6722c08 fix deadlocks for MNVERIFY processing (#1173) 2016-11-30 04:48:05 +04:00
Tim Flynn
e3e5b81a8d Removed CGovernanceManager::ClearSeen() (#1171) 2016-11-29 17:32:41 +04:00
Tim Flynn
286f6ad87e Add watchdog expiration map to governance cache (#1170)
* Fix misspelled logging category

* Added mapWatchdogObjects to governance cache and bumped format version
2016-11-29 04:01:03 +04:00
UdjinM6
0600a6ce1a Fix (dead)locks (#1169)
* locks in PS

* lock in governance

* locks in IS

* lock in ProcessGetData

* locks in CMasternodeSync

* centralize mnodeman.Check call

* locks order in mnpayments

* use current block chainTip when possible (less locks)

* add missing lock in CountInputsWithAmount

* fix deadlock RequestLowDataPaymentBlocks/IsTransactionValid

* LOCK2 in CheckMnbAndUpdateMasternodeList, CheckAndUpdate, SendVerifyRequest

* LOCK(cs) is not needed here

* Decouple governance init actions from serialization
Should fix this:
```
Assertion failed: lock governance.cs not held in governance-classes.cpp:117; locks held:
cs_Shutdown  init.cpp:200 (TRY)
cs  ./governance.h:195
cs  governance.cpp:835
Abort trap: 6
```
2016-11-28 18:21:50 +04:00
Tim Flynn
ecdc160119 Governance object deletion changes (#1167)
* Increase quorum for object deletion to 2/3 of MN network

* Implement expiration of watchdog objects

* Remove objects from the watchdog map itself

* Message fix for invalid objects
2016-11-25 18:08:48 +04:00
Tim Flynn
1b90d66ab6 Implement orphan object and vote timeouts (#1166) 2016-11-24 22:12:05 +04:00
Tim Flynn
3e8c0062a0 Implement SPORK_14_REQUIRE_SENTINEL (#1163) 2016-11-23 19:30:36 +04:00
Nathan Marley
ec59862506 Implement getcurrentvotes JSONRPC call (#1164) 2016-11-22 23:26:36 +04:00
UdjinM6
9c4e019c36 bump proto (#1162)
70202 -> 70203
2016-11-22 19:14:28 +04:00
UdjinM6
470239bbc5 Fix IS: (#1161)
- TXLOCKREQUEST should be processed as normal tx plus some custom logic, should not "fake" inventory
- should not create "fake" local lock, should instead keep track of orphan votes and reprocess them when corresponding TXLOCKREQUEST arrives
- orphan vote time map should be indexed by full outpoint, not by txid of mn collateral

bump MIN_INSTANTSEND_PROTO_VERSION
2016-11-22 18:54:26 +04:00
UdjinM6
e84f393571 more info in getpoolinfo rpc, privatesend rpc should only do actions (#1154) 2016-11-22 00:40:56 +04:00
UdjinM6
785adad57e Slightly refactor/fix IS (#1153)
* slightly refactor IS:
- the only place where logic is changed: `ProcessTxLockVote()` - it should first try to find mn and fail if none was found and only then try to call `GetMasternodeRank()` (which is heavy)
- fixed few `cs_main`
- slightly optimized number of `tx.GetHash()` calls
- lots of `const` (fixed few related functions in main.cpp)
- few smaller fixes: iterators, log output, comments, etc
- use thread safe methods of mnodeman
- safety check in GetAverageUnknownVoteTime
2016-11-22 00:40:32 +04:00
UdjinM6
9162c56419 Refactor HelpMessageDialog to reuse it for PS help info, add PS info to help menu (#1144) 2016-11-20 10:54:33 +04:00
UdjinM6
c2ec99ba8e thread safe rand (#1157)
* thread safe InsecureRand class

* remove GetInsecureRand, use GetRandInt for performance non-critical parts
2016-11-20 10:52:45 +04:00
UdjinM6
e121829e40 few trivial fixes in init.cpp (#1155)
* few trivial fixes in init.cpp

* DEFAULT_PRIVATESEND_LIQUIDITY

* fix InitParameterInteraction
2016-11-20 10:52:23 +04:00
Tim Flynn
e59bee8114 Masternode syncing changes (#1149)
* Modified DSEG to send mnb regardless of state

* Removed unused function

* Deactivate rate check when processing masternode orphan objects
2016-11-18 18:17:22 +04:00
Tim Flynn
90bd7cb62b Implemented delay for governance object deletion (#1151) 2016-11-18 18:17:00 +04:00
Spencer Lievens
efa36242a3 Remove duplicated include of governance.h (#1152) 2016-11-18 18:16:30 +04:00
Spencer Lievens
73568be5a3 Remove Duplicated Include for darksend.h (#1150) 2016-11-18 00:39:08 +04:00
UdjinM6
ce88ab3144 Refactor IS - rename only (+related log messages) (#1146) 2016-11-17 04:31:35 +04:00
UdjinM6
7a005a911e Merge pull request #1142 from crowning-/patch-1
[UI] TrayIcon + TrayIconMenu for OSX
2016-11-17 02:52:20 +04:00
UdjinM6
79af6fddea Merge pull request #1145 from tgflynn/v0.12.1.x-mn-startup-fix
Exit if cache files can't be read
2016-11-17 02:49:19 +04:00
UdjinM6
0991a78cfc Merge pull request #1147 from tgflynn/v0.12.1.x-mn-orphan-fix
Fix CheckMasternodeOrphanObjects iterator
2016-11-17 02:46:35 +04:00
Tim Flynn
112986edab Fix CheckMasternodeOrphanObjects so that iterator is incremented once per passage through the loop block 2016-11-16 17:28:10 -05:00
crowning-
9071136c9b [UI] TrayIcon + TrayIconMenu for OSX (review changes) 2016-11-16 22:04:33 +01:00
crowning-
12691e15d4 [UI] TrayIcon + TrayIconMenu for OSX (review changes) 2016-11-16 22:04:26 +01:00
Tim Flynn
47d09ac2db Exit if cache files can't be read 2016-11-16 10:37:40 -05:00
UdjinM6
5128085240 Merge pull request #1134 from UdjinM6/PSFixes
Yet another PrivateSend refactoring/optimization - core part
2016-11-16 13:07:06 +04:00
UdjinM6
a7dae03bfb Merge pull request #1143 from tgflynn/v0.12.1.x-mnodeman-cleanup
CMasternodeMan cleanup
2016-11-16 12:28:57 +04:00
UdjinM6
426051687d Merge pull request #1141 from tgflynn/v0.12.1.x-gov-mn-sync-fix-pr-2
Masternode syncing fix
2016-11-16 12:28:40 +04:00
Tim Flynn
ad0e3514c2 Added indexMasternodes to CMasternodeMan::Clear() 2016-11-15 21:31:14 -05:00
Tim Flynn
087d3d22df Remove unused CMasternodeMan method and argument 2016-11-15 21:09:37 -05:00
crowning-
544d220819 [UI] TrayIcon + TrayIconMenu for OSX 2016-11-15 23:38:04 +01:00
Tim Flynn
c00fdb524a Added peer id to CGovernanceManager::Sync log message 2016-11-15 08:23:49 -05:00
Tim Flynn
c4c4f1dad7 Ensure governance objects are still valid before relaying 2016-11-14 21:27:05 -05:00
Tim Flynn
6deb3a65a3 Implemented missing masternode handling 2016-11-14 21:13:42 -05:00
Tim Flynn
35a45097ed Added IsValidLocallyMethod overload which returns masternode status flag 2016-11-14 21:13:08 -05:00
Tim Flynn
a3277ea422 Set error string for unparseable objects 2016-11-14 21:12:55 -05:00
UdjinM6
714f9a4f0d Fix PR1135 bugs (#1140)
* Move vote relaying into ProcessVote so that local votes are relayed

* Change signature of Insert method to return indication of whether insertion succeeded

* Only process orphan votes once

* Fix function name in log messages
2016-11-15 01:14:58 +04:00
Tim Flynn
aaf96c9a00 Fix function name in log messages 2016-11-14 15:28:46 -05:00
Tim Flynn
31370decd7 Changed log message handling due to code review suggestion 2016-11-14 15:26:53 -05:00
Tim Flynn
d167772643 Only process orphan votes once 2016-11-14 13:22:50 -05:00
Tim Flynn
08e977efe5 Change signature of Insert method to return indication of whether insertion succeeded 2016-11-14 13:17:42 -05:00
Tim Flynn
fd1327031b Moved vote relaying into ProcessVote so that local votes are relayed 2016-11-14 13:07:11 -05:00
Tim Flynn
c31ba8ba4c New vote tallying implementation (#1135) 2016-11-13 21:52:34 +04:00
Tim Flynn
82ca5fdbb8 CGovernanceManager initialization fix (#1138)
* Fix CGovernanceManager initialization problem

* Added logging messages for cases where CGovernanceManager receives a message while not synced

* Prevent potential NULL pointer dereference
2016-11-12 15:14:50 +04:00
UdjinM6
4b4921d8ce reset pSubmittedToMasternode in SetNull() 2016-11-11 11:29:13 +03:00