Commit Graph

13120 Commits

Author SHA1 Message Date
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
d2f1fd253c Fix exit codes (#1127)
* Fix exit codes:
- `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error)
- error reading config file should exit with error
- slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)
- every main()/exit() should return/use one of EXIT_ codes instead of magic numbers
2016-11-11 09:16:39 +04:00
crowning-
f21c7cc9d8 [Build] Re-include Windows/wine test into Travis build (#1137) 2016-11-09 02:53:52 +04:00
crowning-
b11cc8f1a8 [Build] fix travis.yml (#1133) 2016-11-08 01:00:31 +04:00
UdjinM6
fef8752cd0 remove excessive bool arg in dscomplete (#1124) 2016-11-07 03:27:51 +04:00
UdjinM6
f2d2b25130 dsq fixes: (#1128)
- make sure dsq is not too much in the future
- do not process seen dsq
- do not alter nTime for dsq localy, use memory only fTried instead
2016-11-07 03:27:26 +04:00
UdjinM6
eca1e8a4f1 few small fixes: (#1125)
- fail to process dsa when session is already ready
- fail to process dsvin if session is not ready yet
- fail to process any message on the wrong side (mn/client)
- fail in PrepareDenominate if pool already has entries
- fail if can't sign anything in final tx, also reset local pool in such case
- fix "number of entries" pushed on DSSTATUSUPDATE
2016-11-07 03:27:10 +04:00
UdjinM6
440fc21fbf fix dsq rate limit bug: should not use vecMasternodesUsed when connecting from queue, should check nLastDsq only (#1123) 2016-11-07 03:26:51 +04:00
Tim Flynn
bc96f288ed Governance fixes (#1131)
* Added net logging messages in main.cpp

* Added logging for trigger removal

* Improved log message for CGovernanceManager::UpdatedBlockTip

* Improved log messages in CGovernanceManager::UpdateCachesAndClean

* Added more logging to CGovernanceTriggerManager

* Check vote validity before pushing inventory during sync

* Add triggers to map after loading governance.dat file
2016-11-05 20:13:30 +04:00
crowning-
eb92933d52 [UI] In-wallet PrivateSend help (#1129) 2016-11-05 20:13:16 +04:00
UdjinM6
a4dfcae8f9 fix crash (#1126)
Fixes dash-qt --version (--help etc) crash (Segmentation fault: 11)
2016-11-02 22:43:20 +04:00
UdjinM6
9ed18fdcbe refactor Charge*Fees to have less steps, also switch it to mempool instead of wallet (#1122) 2016-11-02 22:05:30 +04:00
UdjinM6
ee60f6e76a refactoring PS, cleanup, more log output in debug mode (#1121)
* refactoring PS, cleanup, more log output in debug mode (part of #1120)

* fix dsq rate limit calculations on new dsq
2016-11-02 19:54:36 +04:00
Nathan Marley
4894345a58 patch from @udjinm6 -- extract hash calc from loop (#1119)
calculate hash once before entering loop, should make it around an order of magnitude faster
2016-10-31 22:20:49 +04:00
Holger Schinzel
b3f14b3c30 Fix Windows Packaging 2016-10-31 14:03:06 +01:00
Holger Schinzel
3b83dd4fd6 Fix Pi packaging
b97acc6 fixing packaging, #1106 broke it
2016-10-31 12:19:08 +01:00
Holger Schinzel
a6c90c274b Merge pull request #1114 from dashpay/v0.12.1.x_packaging
Fix Gitian Packaging
2016-10-31 11:12:27 +01:00
Holger Schinzel
74772d336d fixing packaging, #1106 broke it 2016-10-31 11:06:22 +01:00
TheLazieR Yip
768eb2044f Add support for compile with ENABLE_DASH_DEBUG defined (#1112) 2016-10-31 13:56:24 +04:00
TheLazieR Yip
fb3b2f1853 Fix errors in DBG when compile with ENABLE_DASH_DEBUG defined. (#1111) 2016-10-31 13:11:57 +04:00
Holger Schinzel
03e4fd7539 Merge pull request #1113 from dashpay/v0.12.1.x_packaging
Fix Linux packaging
2016-10-31 08:51:34 +01:00
Holger Schinzel
62bf64261d fixing packaging, #1106 broke it 2016-10-31 08:48:59 +01:00
UdjinM6
afc74707f8 PoSe changes: (#1105)
* PoSe changes:
- use helpers to alter nPoSeBanScore within predefined range only
- use nPoSeBanHeight instead of timeout of inactivity to ban masternodes till some block in the future (currently should block for the whole payment cycle)
- add log output on pose score increase in CheckSameAddr
2016-10-31 00:56:47 +04:00
UdjinM6
d9d6d4f6eb fix deadlock on sync (#1104) 2016-10-30 23:40:30 +04:00
UdjinM6
ce8e81d752 packaging fixes: (#1106)
- more dash -> dashcore
- dashpay.io -> dash.org
2016-10-30 23:38:19 +04:00
crowning-
81502761b6 [UI] Fix for empty Masternode list when mncache.dat exists (#1107)
* [UI] Fix for empty Masternode list when mncache.dat exists [review changes]

* [UI] Fix for empty Masternode list when mncache.dat exists [review changes]
2016-10-30 23:37:51 +04:00
TheLazieR Yip
740fcce6a4 Fix Governance Object's Expiration calculation. (#1109)
Use nSuperblockCycle instead of "blocks monthly" approximation
2016-10-30 23:36:52 +04:00
Tim Flynn
1a81c341bc Set initial masternode last watchdog time to mnb.sigTime (#1098)
Set last watchdog time to mnb.sigTime when masternodes are first added or updated from a broadcast
2016-10-27 20:00:06 +04:00
Tim Flynn
db3a4afddb Replaced LOCK with LOCK2 to prevent a deadlock (#1103) 2016-10-27 19:58:12 +04:00
UdjinM6
19569c1d66 Fix CActiveMasternode (#1102)
* add GetStateString and static CMasternode::StateToString helpers

* Fix CActiveMasternode:
- should run `ManageStateLocal` only when `eType == MASTERNODE_LOCAL`
- should set `nState = ACTIVE_MASTERNODE_NOT_CAPABLE` in `ManageStateInitial` to let `GetStatus` return proper message
- more/better log output
2016-10-27 01:21:39 +04:00
UdjinM6
77852d938e refactor and fix PS collateral creation (#1092) 2016-10-26 03:33:52 +04:00
UdjinM6
02b9f248a8 update masternode_conf.md (#1097) 2016-10-25 19:04:09 +04:00
Tim Flynn
e30f8bf6a0 Allow masternode broadcasts to update masternode information regardless of state (#1094)
* Allow MN broadcasts to update MN information regardless of state

* Add masternode public keys to log output for debugging

* Moved log message from start-alias to CMasternodeBroadcast::Create

* Fixed log message
2016-10-25 18:37:33 +04:00
Tim Flynn
0cc4997501 Lock coins in masternode.conf regardless of masternode state (#1096)
* Lock coins in masternode.conf regardless of masternode state of local node

* Prevent log masternode.conf messages when file is empty
2016-10-25 17:46:38 +04:00
UdjinM6
c0a830aa8e fix fCheckSigTimeOnly (renamed to fSimpleCheck) in CMasternodePing::CheckAndUpdate (#1093) 2016-10-25 17:46:21 +04:00
UdjinM6
01990272e5 fix dstx acceptance (#1091)
* fix dstx acceptance

* two more fixes:
- do not re-verify dstx once accepted
- fix dstx prioritization

* return early for dstx conditions, more log verbosity
2016-10-24 22:12:36 +04:00
Tim Flynn
4d95be602a Fix deadlock in masternode start commands (#1090) 2016-10-24 03:14:54 +04:00
UdjinM6
565fa31850 fix PS: (#1089)
* PS: should check for prevout to match inputs

* fix CDarkSendEntry constructor
2016-10-23 19:27:23 +04:00
UdjinM6
ed0a0d2393 fix1087 (#1088) 2016-10-23 01:01:30 +04:00
Tim Flynn
1b230f4ddc Deadlock fixes (#1087)
* Fix deadlocks by reducing scope of cs_main locks in rpcgovernance.cpp

* Remove unnecessary mutex lock in GetMasternodeVinAndKeys which can cause a deadlock
2016-10-22 20:52:36 +04:00
UdjinM6
2d55b70381 (log) tweaks and (general) cleanup (#1086)
* docs

* deprecated/unused/duplicate

* comments

* log cleanup/verbosity tuning

* names/ifs/whitespaces/std
2016-10-22 20:52:14 +04:00
UdjinM6
66c40e0687 always check for valid block hash in mnping (#1076) 2016-10-21 01:12:42 +04:00
UdjinM6
609aa7de2a Fix and refactor PS (#1084) 2016-10-21 01:11:57 +04:00
UdjinM6
342bda5fdc new PoSe - MNVERIFY (#1066) 2016-10-21 01:11:30 +04:00
Tim Flynn
cce7896d70 Allow last ping time to be updated for masternodes in the EXPIRED state (#1083) 2016-10-18 15:11:36 +04:00
CHAE-PIL LIM
9db6b97979 [ZMQ] append a message sequence number to every ZMQ notification (#1082)
* Zmq sequence (#1)

* Fixes ZMQ startup with bad arguments.

pr 7621

* [ZMQ] append a message sequence number to every ZMQ notification

- pr 7762
- contrib/zmq/zmq_sub.py to python 3 compatible

* typo in MSG_RAWTXLOCK

MMSG_RAWTXLOCK to MSG_RAWTXLOCK

* s/Bitcoind/dashd/
2016-10-18 00:09:21 +04:00
Nathan Marley
7a45c9308a bugfix: remove duplicate MN votes from getvotes (#1077) 2016-10-17 22:56:27 +04:00
Tim Flynn
94e38e3184 V0.12.1.x sentinel watchdog pr (#1079)
Squashed:

* Replaced unsafe mnodeman.Find function with Get in governance-vote.cpp

* Reject unparsable governance objects

* Implemented sentinel watchdog objects (separated out from locking changes)

* Added WATCHDOG support to rpcgovernance.cpp

* Implemented WATCHDOG_EXPIRED state for masternodes

* Added serialization of watchdog timestamps

* Masternode fixes
 - Added version check to CMasternodeMan deserialization
 - Added several missing locking calls in CMasternodeMan

* Fixed missing member initialization in CMasternode constructor and added more logging

* Added MASTERNODE_WATCHDOG_MAX_SECONDS to governanceinfo

* Added masternodewatchdogmaxseconds info to getgovernanceinfo help

* Make masternodes remain in WATCHDOG_EXPIRED state unless removed or collateral expires

* Allow watchdog object creation by WATCHDOG_EXPIRED MN

* Fixed MN validation logic for governance object creation

* Count total masternodes instead of enabled masternodes in masternode-sync

* Transition out of WATCHDOG_EXPIRED state if the watchdog is inactive

* Fixed IsWatchdogExpired bug

* Fixed rate check for watchdog objects and no longer check MN state when validating governance objects

* Applied PR #1061 patch

* Ported locking changes from other branch

* Require only 1 block between new watchdog objects

* Accept pings for WATCHDOG_EXPIRED masternodes

* Lock CmasternodeMan::cs in CmasternodeMan::ProcessMessage

* Several governance changes
 - Fixed uninitialized value in CGovernancePayment class
 - Return an error on submission if any superblock payment cannot be parsed
 - Added logging more statements

* Explicitly initialize all governance object members

* Fix deadlock

* Fixed non-threadsafe access to masternode in activemasternode.cpp

* Revert added wallet lock

* Changed CActiveMasternode so that watchdog expired nodes can still send pings

* Modified CActiveMasternode to run pinger regardless of state when MN is in list

* Added voter and time information to getvotes command

* Improved CActiveMasternode state management

* Implemented GetInfo functions for more efficient thread-safe access to masternode information

* Added CActiveMasternode debug logging messages

* Fixed initial type setting and error message for incorrect protocol version

* Changes based on code review comments

* Set active state for local mode
2016-10-17 22:54:28 +04:00
UdjinM6
a584a68634 Revert few parts of #1073 - too early for node version check (and it's not necessary to do so there anyway) (#1080) 2016-10-16 23:23:42 +04:00
UdjinM6
bdcc9ab47c Refactor PS code to deal with denoms in a more generic way (#1071) 2016-10-16 23:23:17 +04:00