Commit Graph

9502 Commits

Author SHA1 Message Date
UdjinM6
6aaec3ae2a Fail to proceed in listsinceblock if provided blockhash can't be found (#1393)
If daemon crashes, it can't save latest block sometimes, so querying daemon
for presumably best/last hash would result in a list of all txes recognized by
this wallet as its own since genesis block which could be confusing,
to say at least. Same applies for typos etc. This should fix it.

Not sure why but such weird behaviour was the case since listsinceblock rpc was
initially introduced in Bitcoin 0.5 (Oct 5, 2011)
3a6e468d9a
2017-03-13 07:29:01 +01:00
UdjinM6
c523205386 implement importelectrumwallet (#1377)
Imports keys from an Electrum wallet export file (.csv or .json)
2017-03-12 15:42:00 +01:00
crowning-
fb3db0a57e [UI] Typo fixed (#1391) 2017-03-12 15:41:36 +01:00
Tim Flynn
fc7eca597d Locking fix for UpdatePreferredDownload (#1389) 2017-03-09 02:36:50 +04:00
Tim Flynn
eb4e6a32dd Fix deadlocks on cs_vSend in RequestGovernanceObject (#1387) 2017-03-09 02:36:40 +04:00
Tim Flynn
c8b6199979 Periodicially request orphan objects (#1383)
* Implement RequestOrphanObjects

* Ensure governance objects are only requested from peers once per call

* Add gobject log messages

* Implemented CleanOrphanObjects

* Move governance maintenance functions from NewBlock to a time-based function

* Remove unused delcaration for mapAskedForGovernanceObject
2017-03-06 08:46:59 +01:00
Holger Schinzel
85d152bac0 bump to 0.12.1.4 (#1376) 2017-03-05 23:16:30 +04:00
Tim Flynn
9537062aff Implemented utility functions for copying/releasing vNodes vector (#1382)
* Implemented utility functions for copying/releasing vNodes vector

* Refactor code to use new utility functions CopyNodeVector/ReleaseNodeVector
2017-03-05 23:16:12 +04:00
UdjinM6
119fe83bb4 Do not send outdated MNs on sync (#1373) 2017-03-02 00:31:53 +04:00
UdjinM6
5598d640e6 Do not force disconnect for stalled nodes on sync (#1374)
They might be simply busy serving us another data
2017-03-02 00:31:41 +04:00
UdjinM6
1c63052c3e fix recently observed crash on IsValid (#1375)
* fix recently observed crash on IsValid

+some small cleanup

* txin.prevout.n should not exceed txOutpointCreated.vout.size()

* fix log output
2017-03-01 21:30:43 +01:00
Holger Schinzel
295e94d66a bump to 0.12.1.3 (#1371) 2017-03-02 00:30:21 +04:00
QuantumExplorer
8c64c0a7cf fixed protobuf 3.0 (byteswap) issue on macOS (#1370) 2017-02-28 13:00:02 +04:00
chaeplin
d26916ad5b make sendrawtransaction to accept 2nd optional (#1369) 2017-02-28 12:59:49 +04:00
Spencer Lievens
01eeb59af6 Splashscreen now displays correctly (Fully) (#1367)
* Splashscreen now displays correctly on retina devices

* Remove devicePixelRatio instances
2017-02-28 12:59:27 +04:00
UdjinM6
a1ef547918 only consider higher hashes if they don't exceed nExpirationDelay (#1361) 2017-02-23 21:23:30 +04:00
Tim Flynn
0bc6d92334 Define current votes by creation time instead of arrival time (#1360) 2017-02-23 16:29:00 +04:00
UdjinM6
636fb33e71 implement sentinel-like wd selection logic (#1359)
* Only accept wd's that are more recent or have a higher hash than the current best

* Fix whitespace typo

* Relay current watchdog when lower priority ones are received

* Fix nHashWatchdogCurrent reset conditions

* expire previous current wd when a new one is found in UpdateCurrentWatchdog

* fail to process votes for expired or deleted object
2017-02-22 22:29:30 +04:00
Holger Schinzel
17cf8dc6d1 bump to 0.12.1.2 (#1355) 2017-02-21 00:26:11 +04:00
UdjinM6
e9e5a24910 fixing strings and docs + instantsend.md (#1354) 2017-02-19 22:02:33 +01:00
crowning-
e3288a7e14 [RFC] add ObjectType to first-level JSON result (#1352) 2017-02-19 17:55:52 +01:00
UdjinM6
f59bd434ad fix gov list filtering bug (#1353) 2017-02-19 17:55:37 +01:00
UdjinM6
6d2cc99e35 Add "enough data" stop conditions for gov sync (#1350)
* Add "enough data" stop conditions for gov sync

* fix:
- make sure condition is checked only once per tick
- let condition be fully used on resync (reset nTimeNoObjectsLeft)
2017-02-18 00:08:41 +04:00
UdjinM6
91f7e57402 fix verification network behaviour: (#1348)
* fix verification network behaviour:
- use up to 10 connections only
- save state (do not ask same nodes after restart)
- initiate on time based intervals (every 5 minutes), based not on new blocks (should keep connections alive longer)

* revert mWeAskedForVerification serialization

* send verify requests using MAX_POSE_CONNECTIONS as a step
2017-02-18 00:08:29 +04:00
UdjinM6
31d8e03a2b Update sendcoinsentry.ui (#1343) (#1349)
Replacing 'bitcoins' in tooltip
2017-02-17 13:37:34 +04:00
UdjinM6
57fd9e9e2a fix watchdogs (#1346)
* fix watchdogs:
- do not accept if CreationTime is out of bounds (using CreationTime, not local time now)
- do not sync expired
- fix disk serialization

* drop watchdogs early, avoid adding//removing

* clean mapWatchdogObjects when object is deleted via votes
2017-02-17 04:48:42 +04:00
UdjinM6
f774daf47f a bit more granular sync checks for mnpayment (#1344) 2017-02-17 04:48:29 +04:00
TheLazieR Yip
e89b12d0c5 Gracefully not accept incoming connection (#1342) 2017-02-16 19:40:40 +04:00
UdjinM6
80b71d9746 Few networking fixes (#1341)
* Few networking fixes:
- skip "masternode"/inbound connections for sync related processes
- do not sync gov data to other nodes until fully synced ourselves
- do not accept incoming connections until fully synced

* inbound connections could be harmful only if our node is a masternode

* same for CGovernanceManager::Sync
2017-02-16 19:14:42 +04:00
crowning-
23fa1f5f13 [Trivial] maxconnections parameter help text modified (#1340) 2017-02-16 19:14:29 +04:00
Bob Feldbauer
af1177dd54 Update for OpenSSL 1.1 API. (#1336)
* Update for OpenSSL 1.1 API.

* Update qt/paymentrequestplus.cpp for OpenSSL 1.1 API.

* Fix missing # in if for qt/paymentrequestplus.cpp fix for OpenSSL 1.1 API change.

* Fix indentation in src/qt/paymentrequestplus.cpp.
2017-02-15 19:18:24 +04:00
UdjinM6
6483e6d06f send confirmation dialog box should display correct smallest denom (#1329) 2017-02-12 01:04:08 +04:00
UdjinM6
f08ae49904 Fix crash on initial mixing step: (#1331)
* Fix crash on initial mixing step:
- skip nodes marked to be disconnected
- add/release ref to make sure pnode is not deleted in the middle of the process

* - fix copy/paste mistake (nTries)
- let ConnectNode manage ref for non-mn pnodeFound
2017-02-11 03:57:09 +01:00
UdjinM6
817fd9c860 bump build to 0.12.1.1 (#1330) 2017-02-11 03:56:55 +01:00
Tim Flynn
0b54ab85c8 Fix locking issues in dash-qt masternodelist (#1328)
* Add last ping time to masternode_info_t

* Use thread safe functions to access mnodeman in masternodelist.cpp

* Fix masternodelist widget locking

* Protect access to widget data from StartAlias button
2017-02-10 04:56:52 +04:00
taw00
4fcc766a29 The denominations changed with 12.1 - Fixed how messaged in the help text. (#1327) 2017-02-10 04:52:01 +04:00
UdjinM6
b6be968c2f Fix rpc (#1325)
* no wallet passphrase in masternode(broadcast) and darksend rpc

* spork values are int64
2017-02-10 04:51:47 +04:00
Tim Flynn
fecb3e4fe6 Fix some uninitialized variables in dash-qt (#1324)
* Fix uninitialized variables in WalletModel

* Fix uninitialized variable on overviewpage startup
2017-02-09 09:29:00 +04:00
UdjinM6
56971f8da1 Fix CMasternodeConfig::read (#1322)
CService fails to initialize correctly on Windows for whatever reason,
replacing this functionality with SplitHostPort call.
2017-02-06 01:29:23 +04:00
Tim Flynn
8de792291a Add a mutex lock to protect CNode::nRefCount (#1321)
* Add a mutex lock to protect CNode::nRefCount

* Added logging statement for CNode removal
2017-02-05 20:45:36 +04:00
Tim Flynn
5520bf6895 Masternode index rebuild bug fix (#1318)
* Clear old masternode index after vote map rebuild

* Add masternode index size to CMasternodeMan::ToString
2017-02-05 13:24:34 +04:00
UdjinM6
1d45023f3e assert on Release (#1317) 2017-02-04 22:47:38 +04:00
UdjinM6
bd3978fd4b Fix IS vote expiration/cleanup: (#1316)
- vote should be removed when corresponding orphan vote expires
- fix CInstantSend::SyncTransaction: mapTxLockVotes is indexed by vote hash, not by tx hash (use votes from candidates and from orhpan vote map to avoid looping through the whole vote map)
2017-02-04 22:17:45 +04:00
UdjinM6
8c6f756362 put some reasonable limits on SPORK_12_RECONSIDER_BLOCKS (#1312)
* put some reasonable limits on SPORK_12_RECONSIDER_BLOCKS

* 6h -> 24h
2017-02-04 04:42:04 +04:00
UdjinM6
636e48b2a8 fix off-by-1 bug in DisconnectBlocks (#1313) 2017-02-04 04:41:32 +04:00
UdjinM6
cedd269cb0 shift CSV deployment window on mainnet to "Feb 5th, 2017 - Feb 5th, 2018" (#1314) 2017-02-04 04:41:18 +04:00
Tim Flynn
0ecc7c61eb Adjust start of 12.1 superblocks (#1311) 2017-02-03 21:41:22 +04:00
Tim Flynn
3840d97027 Fix division by zero (#1310)
* Fix division by zero

* Fixes based on code review comments

* Fix nProjectedVotes value

* Set nProjectedVotes to 2000
2017-02-03 13:17:47 +04:00
UdjinM6
1486acfb99 remove IS number of inputs limit, add warning instead (#1308) 2017-02-03 02:38:33 +04:00
UdjinM6
f729d8227b bump gov cache version to start from scratch (#1306) 2017-02-02 17:43:40 +04:00
UdjinM6
c5210a3e5b Adjust gov sync (#1305)
* Adjust gov sync:
- simulate mainnet gov obj sync conditions on testnet
- add redundancy: ask up to 3 peers for the same obj

* stop loop if max number of peers per obj was asked
2017-02-02 17:04:45 +04:00
Tim Flynn
1f7b46c2c0 Restore 5 Dash fee for proposal creation (#1302) 2017-02-02 12:51:02 +04:00
Tim Flynn
399330d42d Improve governance syncing efficiency with bloom filter (#1299)
* Use bloom filter for governance vote syncing

Modify masternode-sync to send bloom filters

Correctly initialize bloom filter

Set fUseFilter argument

Increase bloom filter size to account for multiple signals

Set bloom filter parameters

Use constants for bloom filter parameters

Added filter size check

Added filter size check in masternode-sync

Update bloom filter

Changed bloom parameters

* Bump protocol version

* Update sync time for inv's

* Changes based on code review comments

* Make bloom filter size network dependent

* Fix network dependent filter parameters

* Remove unneeded constant definition

* Move constant definition

* Add blank line
2017-02-02 12:50:44 +04:00
UdjinM6
cfc8954b42 Shift PS denoms (#1292)
* Shift PS denoms

* fix ui PS restrictions
2017-02-02 12:50:21 +04:00
Tim Flynn
a73185d939 Increment node refcount before adding to vector (#1304) 2017-02-02 12:22:47 +04:00
Tim Flynn
944420deb0 Fix deadlock in governance on cs_main (#1303) 2017-02-02 03:07:24 +04:00
UdjinM6
3bfa5392fa fix flag/ref order + cs_vNodes in ConnectNode (#1300)
* fix flag/ref order

* hold cs_vNodes in ConnectNode a little bit longer

* fix
2017-02-01 21:24:00 +04:00
UdjinM6
c8466cfb04 fix lock order in ThreadMnbRequestConnections (#1298) 2017-01-31 21:11:21 +04:00
UdjinM6
572c554681 Multiple mnb recovery (#1297)
* ask for multiple mnb hashes for recovery

* address comments, lock cs_vNodes and add/relese ref

* add parentheses
2017-01-31 19:29:27 +04:00
UdjinM6
e2eaf1d0d7 Fix few block processing bugs (#1291)
* protect mapRejectedBlocks by cs_main

* few block reprocessing fixes:
- DisconnectBlock should fail on DisconnectTip failure
- ResolveConflicts should fail on DisconnectBlock failure
- ReprocessBlocks cleanup

* don't ban on IsBlockValueValid/IsBlockPayeeValid failure
2017-01-30 10:01:08 +04:00
Tim Flynn
04ed5db62c Fix Vote iteration bug (#1290)
* Fix Vote iteration bug

* Fix order of statements
2017-01-29 23:09:21 +04:00
UdjinM6
60409df822 InstantSend overhaul (#1288)
* Multi-quorum InstantSend, complete refactoring
+ cleanup for IS and partial protobump

* more changes:
- allow InstantSend tx to have 10 inputs max
- store many unique tx hashes in mapVotedOutpoints
- more checks in AcceptToMemoryPoolWorker (moved from ProcessMessage + CTxLockRequest(tx).IsValid() )

* More changes:
- let multiple lock candidates compete for votes
- fail to vote on the same outpoint twice early

* More changes:
- notify CInstantSend on UpdatedBlockTip -> remove cs_main from CheckAndRemove()
- notify CInstantSend on SyncTransaction -> count expiration block starting from the block corresponding tx was confirmed instead of the block lock candidate/vote was created
- fixed few locks

* add comments about nConfirmedHeight

* Fix "Block vs Lock" edge case

* Fix "Block vs Lock" edge case, p2

* Fix issues:
- fix logic for locking inputs and notifying - see UpdateLockedTransaction, TryToFinalizeLockCandidate
- add missing hash inserting in ProcessTxLockVote
- add nMaxBlocks param to ResolveConflicts to limit max depth allowed to disconnect blocks recursively
- fix false positive mempool conflict
- add missing mutex locks
- fix fRequireUnspent logic in CTxLockRequest::IsValid
2017-01-29 12:22:14 +04:00
Tim Flynn
9c5db04953 Fix datadir initialization in dash-qt (#1287) 2017-01-27 18:07:13 +04:00
TheLazieR Yip
534effaf85 Set width=18 to support NEW_START_REQUIRED status in masternodelist full (#1281) 2017-01-25 15:37:45 +04:00
UdjinM6
d8797023c8 move mnb verification requests to their own thread (#1274)
* move mnb verification requests to their own thread, should remove related ui/rpc freezes

* vector -> list
2017-01-21 23:03:55 +04:00
Tim Flynn
348c001445 Fix governance-votedb index bug (#1278) 2017-01-21 09:26:35 +04:00
TheLazieR Yip
2a43d23f95 Enable sendrawtransaction to send IS (#1271)
* Enable sendrawtransaction to send IS

* InstantSend as optional for sendrawtransaction
2017-01-20 03:00:47 +04:00
UdjinM6
a7d172fafd update list of mn states in masternodelist rpc help (#1272)
fix #1266
2017-01-19 23:06:56 +04:00
Tim Flynn
70b2f3e083 Limit number of warning messages logged by CNode's (#1273) 2017-01-19 23:06:32 +04:00
Tim Flynn
0233d87739 Do not call CloseSocketDisconnect from non-socket handler threads (#1276) 2017-01-19 23:02:57 +04:00
Tim Flynn
4b7bd6be8f Governance masternode notification bug fixes (#1270)
* Flag governance items when MN's are removed

* Remove old broken update mechanism

* Do not flag MN state changes which are irrelevant to validity

* Call AddGovernanceVote
2017-01-18 19:24:19 +04:00
Tim Flynn
5254255a0a Voting related syncing changes (#1269)
* Remove vote count check from IsValidLocally

* Do not check voted validity flag when syncing

* Do not send objects marked for deletion during syncing

* Remove node penalty for unrequested objects.
2017-01-18 19:24:04 +04:00
Tim Flynn
2ea9c69985 Logging improvements (#1268)
* Add default log messages when beginning asset sync

* Added default log message for AskFor buffer full condition

* Improve log message based on code review comments
2017-01-18 19:23:49 +04:00
UdjinM6
b5239b790e Merge #1267: Fix IS locking/crashes 2017-01-18 07:38:13 +01:00
UdjinM6
f81ea67a08 Remove hashes from setAskFor (#1264)
We should remove hash from setAskFor when the message corresponding to previous inv arrives, otherwise it's stays there forever and setAskFor overflows (i.e. AskFor returns immediately without processing).
2017-01-18 00:02:59 +04:00
UdjinM6
f1ee9d9c71 Change governance sync process (#1265)
* On gov sync first sync objs, then ask for votes on per-obj basis from different peers.

This should help to sync obj list initially and split the load among many peers. Also adds ability to catch up votes later after the sync.

* ask for all objects, do this in cycles

* Fix Sync() code, better readability

* ask multiple nodes at once when possible, perf boost for large numper of objs

* Addressed comments: pass reference, more peer version check
2017-01-18 00:02:38 +04:00
UdjinM6
f995a264e2 Do not try to check or verify mns until synced to some stage (#1261)
Verification creates new conections, which we also use to sync but then we disconnect on ProcessMasternodeConnections every minute which at least could lead to excessive node load (for our peers). But could also interfere with sync process itself and we'd better keep them separate.
2017-01-15 02:29:08 +04:00
UdjinM6
e8479675a8 show local time in Masternodes tab (#1244) 2017-01-13 18:03:28 +04:00
UdjinM6
053e374e42 Merge bug fixes (#1260)
* Fix for incorrect locking in GetPubKey() (keystore.cpp)

* Fix Cmd-Q / Menu Quit shutdown on OSX

* Addition of ImmatureCreditCached to MarkDirty()

To protect against possible invalidation and to bring conformity to the code.
2017-01-13 18:02:33 +04:00
UdjinM6
5cb6486616 Assuming that we synced blockchain already if we have at least MASTERNODE_SYNC_ENOUGH_PEERS (6 currently) peers at the same height as we are (#1257) 2017-01-11 03:33:14 +04:00
UdjinM6
621f9ebeca remove GetEstimatedMasternodes and GetTotalCoinEstimate (#1258) 2017-01-11 03:33:01 +04:00
TheLazieR Yip
a42b375a05 Update to listunspent cli command (#1254)
* Add missing description for listunspent help message.

* Add ps_round (PrivateSend Round) in listunspent result

* s/round/rounds/
2017-01-11 03:06:17 +04:00
UdjinM6
9114ef7930 Changes in potential_deadlock_detected behavior: (#1259)
1. print to stdout too
2. only print when it's critical (i.e. going to crash on assert)
2017-01-11 03:00:34 +04:00
UdjinM6
26419596ce bump nMinBlocksToStore 4000->5000 (#1256) 2017-01-11 03:00:22 +04:00
UdjinM6
a930363366 RequestLowDataPaymentBlocks should request unknown payment blocks too (#1255) 2017-01-11 03:00:06 +04:00
Tim Flynn
3b9a748d5e Fix locking order (#1252)
* Add cs_main locks prior to governance locks to ensure correct locking order
2017-01-09 19:09:42 +04:00
UdjinM6
0c2304e24f Backport btc pr7907 (#1253)
Fixing this https://bitslog.wordpress.com/2017/01/08/a-bitcoin-transaction-that-takes-5-hours-to-verify/

* Unit test for CScript::FindAndDelete

* Replace memcmp with std::equal in CScript::FindAndDelete

Function is stl; std::equal just makes more sense.

* Replace c-style cast with c++ style static_cast.

* Improve worst-case behavior of CScript::FindAndDelete

Thanks to Sergio Lerner for identifying this issue and suggesting this kind of solution.
2017-01-09 18:51:04 +04:00
UdjinM6
7e9ad0e26c Migration fixes (#1247)
* clean some network specific qt settings on migration

* ask user to choose datadir if default dir is not the one we expected
2017-01-04 21:47:50 +04:00
snogcel
a9e1361fc2 update voteraw rpc parameters (#1249) 2017-01-04 21:47:16 +04:00
UdjinM6
ba8d8ae027 remove unused pindex from IsValidLocally, fix cs_main in rpc (#1243) 2017-01-03 22:32:52 +04:00
Tim Flynn
8d7866cf6b Update rate check buffer for locally created objects (#1245) 2017-01-03 18:17:29 +04:00
UdjinM6
457c20092f Select peers on initial sync more carefully (#1238)
* Select peers on initial sync more carefully

* allow a small error margin of 1 block

* fix comment/log message
2017-01-01 22:30:40 +04:00
UdjinM6
e4a290693b Recovery from MASTERNODE_NEW_START_REQUIRED state (#1232)
Implement masternode recovery from MASTERNODE_NEW_START_REQUIRED state via mn quorums
2017-01-01 21:48:53 +04:00
TheLazieR Yip
f6ca563ab2 typo in masternodeaddr error message (#1242) 2017-01-01 19:32:08 +04:00
TheLazieR Yip
471365bf6c Masternode Sync should be finished before mining processing (#1240)
* Reject getblocktemplate request until masternode sync is finished

* Pending internal miner until masternode sync is finished
2017-01-01 14:18:33 +04:00
TheLazieR Yip
89d14c5274 Fix Hot Masternode Starting (#1239) 2017-01-01 14:18:21 +04:00
TheLazieR Yip
7815f6e32e Provide correct warning in CheckForkWarningConditions for large worked invalid chain. (#1234) 2017-01-01 14:18:05 +04:00
UdjinM6
7544a70e1b display chainwork for every tip in getchaintips (#1237) 2016-12-30 20:38:53 +04:00
Holger Schinzel
96dda2790c added testnet checkpoint (#1235) 2016-12-30 08:05:29 +01:00
UdjinM6
32d5f4b013 Ignore payments and governance cache when mncache is empty (#1227) 2016-12-26 19:33:28 +04:00