Commit Graph

9751 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
06aa02ff63 Merge #10559: Change semantics of HaveCoinInCache to match HaveCoin
5257698 Change semantics of HaveCoinInCache to match HaveCoin (Alex Morcos)

Tree-SHA512: 397e9ba28646b81fffa53e55064735d4d242aaffdf8484506825f785b0e414f334e4c5cd1e4e1dd9a4b6d1f6954c7ecad15429934a1c4e8d39f596cbd9f5dd80
2017-10-31 21:19:11 +01:00
Pieter Wuille
151c552c71 Merge #10537: Few Minor per-utxo assert-semantics re-adds and tweak
9417d7a33 Be much more agressive in AccessCoin docs. (Matt Corallo)
f58349ca8 Restore some assert semantics in sigop cost calculations (Matt Corallo)
3533fb4d3 Return a bool in SpendCoin to restore pre-per-utxo assert semantics (Matt Corallo)
ec1271f2b Remove useless mapNextTx lookup in CTxMemPool::TrimToSize. (Matt Corallo)

Tree-SHA512: 158a4bce063eac93e1d50709500a10a7cb1fb3271f10ed445d701852fce713e2bf0da3456088e530ab005f194ef4a2adf0c7cb23226b160cecb37a79561f29ca
2017-10-31 21:19:11 +01:00
Wladimir J. van der Laan
4f807422fa Merge #10550: Don't return stale data from CCoinsViewCache::Cursor()
3ff1fa8 Use override keyword on CCoinsView overrides (Russell Yanofsky)
24e44c3 Don't return stale data from CCoinsViewCache::Cursor() (Russell Yanofsky)

Tree-SHA512: 08699dae0925ffb9c018f02612ac6b7eaf73ec331e2f4f934f1fe25a2ce120735fa38596926e924897c203f7470e99f0a99cf70d2ce31ff428b105e16583a861
2017-10-31 21:19:11 +01:00
Alexander Block
9ad56fe18a Dash related fixes for per-utxo DB 2017-10-31 21:19:11 +01:00
Alexander Block
92bb65894b Fix address index to use new per-utxo DB 2017-10-31 21:19:11 +01:00
Alexander Block
d4562b5e51 Fix CCoinsViewCache::GetPriority to use new per-utxo 2017-10-31 21:19:11 +01:00
Pieter Wuille
c81394b975 Merge #10195: Switch chainstate db and cache to per-txout model
589827975 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc7f Increase travis unit test timeout (Pieter Wuille)
73de2c1ff Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552f7 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b02309 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c0c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357f3 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b79a Pack Coin more tightly (Pieter Wuille)
97072d668 Remove unused CCoins methods (Pieter Wuille)
ce23efaa5 Extend coins_tests (Pieter Wuille)
508307968 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e79 Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b56f Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3cb Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e48397 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c1b Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957a3 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe92 Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
000391132 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111a0 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fdac Replace CTxInUndo with Coin (Pieter Wuille)
422634e2f Introduce Coin, a single unspent output (Pieter Wuille)
7d991b55d Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c119 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d34242430 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e0032290 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652fc Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e7e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde6d Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3
2017-10-31 21:19:11 +01:00
Pieter Wuille
afa96b7c12 Merge #10249: Switch CCoinsMap from boost to std unordered_map
e6756ad Switch CCoinsMap from boost to std unordered_map (Pieter Wuille)
344a2c4 Add support for std::unordered_{map,set} to memusage.h (Pieter Wuille)

Tree-SHA512: 51288301e7c0f29ffac8c59f4cc73ddc36b7abeb764009da6543f2eaeeb9f89bd47dde48131a7e0aefad8f7cb0b74b2f33b8be052c8e8a718339c3e6bb963447
2017-10-31 21:19:11 +01:00
Wladimir J. van der Laan
8ed6722196 Merge #10250: Fix some empty vector references
f478d98 Fix some empty vector references (Pieter Wuille)

Tree-SHA512: a22022b9060cd39f8d349e8dd24490614c0028eae2fbc7186d0d26b1d47529049b2daee41f093c0722130274a0b6f7f8671c2295c8cb4a97028771eaff080734
2017-10-31 21:19:11 +01:00
Alexander Block
d23adcc0f1 Merge #10231: [Qt] Reduce a significant cs_main lock freeze (#1704)
4082fb0 Add missing <atomic> header in clientmodel.h (Jonas Schnelli)
928d4a9 Set both time/height header caches at the same time (Jonas Schnelli)
610a917 Declare headers height/time cache mutable, re-set the methods const (Jonas Schnelli)
cf92bce Update the remaining blocks left in modaloverlay at init. (Jonas Schnelli)
7148f5e Reduce cs_main locks during modal overlay by adding an atomic cache (Jonas Schnelli)

Tree-SHA512: a92ca22f90b8b2a5e8eb94fdce531ef44542e21a8dbbb0693f7723d7018592cb68de687a2a0aac91d31cbf019793f8e922550656d2b130ed3d854d60630341db
2017-10-31 23:14:19 +03:00
UdjinM6
14d11e4a8a
Translations 201710 part2 (#1676)
* fix ru

* updating bg, fr, sk, zh_TW

* update fi, pl, zh_TW

* update pl
2017-10-31 17:50:28 +03:00
UdjinM6
470e5435c0
remove InstantSend votes for failed lock attemts after some timeout (#1705) 2017-10-31 17:50:03 +03:00
UdjinM6
dfb8dbbf61
Fix mnp relay bug (#1700)
* relay ping for nodes in ENABLED/EXPIRED/WATCHDOG_EXPIRED state only, skip everyone else

* typo
2017-10-31 17:46:42 +03:00
UdjinM6
673e161d5d
fix trafficgraphdatatests for qt4 (#1699) 2017-10-31 17:46:24 +03:00
UdjinM6
788ae63ac2 Fix edge case for IS (skip inputs that are too large) (#1695)
* fix edge case for IS (skip inputs that are too large)

* fix
2017-10-25 17:57:56 +03:00
UdjinM6
6f57519c60 allow up to 40 chars in proposal name (#1693)
align with 299035e36d
2017-10-25 17:57:39 +03:00
Matt Corallo
6f1997182a Add COMPACTSIZE wrapper similar to VARINT for serialization 2017-10-24 13:54:10 +02:00
Pieter Wuille
fc5ced317f Merge #10445: Add test for empty chain and reorg consistency for gettxoutsetinfo.
513da90cd Add test for empty chain and reorg consistency for gettxoutsetinfo. (Gregory Maxwell)
822755a42 Fix: make CCoinsViewDbCursor::Seek work for missing keys (Pieter Wuille)

Tree-SHA512: e549921e8b8f599bf61ebe0ee7ef1d2f474043723d633e24665fe434b996a98e039612de8a1c2cd16b63f154943ff5ea1c1935e9561cfb813a00d47d926d0b22
2017-10-24 13:54:07 +02:00
Pieter Wuille
9a266e68d0 Merge #10297: Simplify DisconnectBlock arguments/return value
db994b2 Simplify DisconnectBlock arguments/return value (Pieter Wuille)

Tree-SHA512: 62ce1a85bde2a5baffb9173ed28f2d8008200ecf8b09332122f1516fe68b33b9d7223cc1c2fffe804e38f767874c6353b76bd483e8ad7d48c4a5e80d6b683039
2017-10-24 13:54:04 +02:00
Matt Corallo
567043d360 Make DisconnectBlock and ConnectBlock static in validation.cpp 2017-10-24 13:54:00 +02:00
Wladimir J. van der Laan
ff9b2967af Merge #10133: Clean up calculations of pcoinsTip memory usage
1b55e07 Make threshold for flushing more conservative. (Alex Morcos)
f33afd3 Lower default memory footprint slightly (Alex Morcos)
5b95a19 Make pcoinsTip memory calculations consistent (Alex Morcos)

Tree-SHA512: d0061138596cf89008397b8729d9b25293938b1ad454cc99a6fe2f6210e94f76dfa78a8f0fce4c1ba3efec4e742a9c1a3ab26676a4a8346d3e7c3055d032669b
2017-10-24 13:53:59 +02:00
Wladimir J. van der Laan
cfefd34f45 Merge #10126: Compensate for memory peak at flush time
7228ce8 Compensate for memory peak at flush time (Pieter Wuille)

Tree-SHA512: 97e9848410fab061402c85d8440c54a50dd8a0203b2ea194013ea116700a6dc1b4b26b8c5f9c9c68c1f5c6b935c5d6c737437c1911b003d9ff5445c570cd449d
2017-10-24 13:53:55 +02:00
Wladimir J. van der Laan
249db27761 Merge #9999: [LevelDB] Plug leveldb logs to bitcoin logs
cfce581 [LevelDB] Plug leveldb logs to bitcoin logs (NicolasDorier)

Tree-SHA512: e40a2c2644c269bb2da7be04aec39ff64ad350d508391750a757955ed3f9d96998775d01e04b282a75b36d776c3960a345cc7b6f1466e6ae167d27518bf4baee
2017-10-24 13:53:52 +02:00
Pieter Wuille
817ecc03d3 Merge #9353: Add data() method to CDataStream (and use it)
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan)
adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
2017-10-23 19:07:45 +02:00
Pieter Wuille
ceb64fcd47 Merge #8610: Share unused mempool memory with coincache
ba3cecf Share unused mempool memory with coincache (Pieter Wuille)
2017-10-23 19:07:45 +02:00
Pieter Wuille
09b3e042f4 Merge #9310: Assert FRESH validity in CCoinsViewCache::BatchWrite
dd44ea3 Check FRESH validity in CCoinsViewCache::BatchWrite (Russell Yanofsky)
2017-10-23 19:07:45 +02:00
Pieter Wuille
a589c94a9a Merge #9107: Safer modify new coins
b50cd7a Fix dangerous condition in ModifyNewCoins. (Alex Morcos)
2017-10-23 19:07:45 +02:00
Wladimir J. van der Laan
4b4d222933 Merge #9308: [test] Add CCoinsViewCache Access/Modify/Write tests
07df40b [test] Add CCoinsViewCache Access/Modify/Write tests (Russell Yanofsky)
2017-10-23 19:07:45 +02:00
Pieter Wuille
6974f1723d Merge #9346: Batch construct batches
ed58969 Batch construct batches (Pieter Wuille)
2017-10-23 19:07:45 +02:00
Pieter Wuille
6fbe93aa71 Merge #9307: Remove undefined FetchCoins method declaration
fe41f58 Remove undefined FetchCoins method declaration (Russell Yanofsky)
2017-10-23 19:07:45 +02:00
Pieter Wuille
105fd18157 Use fixed preallocation instead of costly GetSerializeSize
Dbwrapper used GetSerializeSize() to compute the size of the buffer
to preallocate. For some cases (specifically: CCoins) this requires
a costly compression call. Avoid this by just using fixed size
preallocations instead.
2017-10-23 19:07:45 +02:00
Pieter Wuille
94e01eb660 Merge #8467: [Trivial] Do not shadow members in dbwrapper
4a35e0f Do not shadow members in dbwrapper (Pavel Janík)
2017-10-23 19:02:49 +02:00
Wladimir J. van der Laan
e3b7ed449f Merge #8273: Bump -dbcache default to 300MiB
efd1d83 doc: Mention dbcache increase in release notes (Wladimir J. van der Laan)
32cab91 Bump `-dbcache` default to 300MiB (Wladimir J. van der Laan)
2017-10-19 10:51:59 +02:00
Wladimir J. van der Laan
952383e16c Merge #7933: Fix OOM when deserializing UTXO entries with invalid length
1e44169 Add tests for CCoins deserialization (Pieter Wuille)
5d0434d Fix OOM bug: UTXO entries with invalid script length (Pieter Wuille)
4bf631e CDataStream::ignore Throw exception instead of assert on negative nSize. (Patrick Strateman)
4f87af6 Treat overly long scriptPubKeys as unspendable (Pieter Wuille)
f8e6fb1 Introduce constant for maximum CScript length (Pieter Wuille)
2017-10-19 10:51:50 +02:00
Wladimir J. van der Laan
753cb1563b Merge #7874: Improve AlreadyHave
c6cb6f7 Avoid unnecessary database access for unknown transactions (Alex Morcos)
2017-10-19 10:51:45 +02:00
Alexander Block
60e6a602e6 Use C++11 thread-safe static initializers in coins.h/coins.cpp
Taken from Bitcoin #8173/888483098e60f2a944f1d246bbfec4d14a2975f8

Needed to align code for upcoming per-utxo backports.
2017-10-19 10:51:40 +02:00
Pieter Wuille
44526af95a Use SipHash-2-4 for CCoinsCache index
This is ~1.7x slower than the Lookup3-of-Xor-with-salt construct we were
using before, but it is a primitive designed for exactly this.
2017-10-19 10:51:28 +02:00
Pieter Wuille
d92b454a25 Add SipHash-2-4 primitives to hash 2017-10-19 10:51:26 +02:00
Alexander Block
02a6cef94d Move index structures into spentindex.h
txdb.h does not include validation.h anymore, so we need these structs somewhere else
2017-10-19 10:51:23 +02:00
Wladimir J. van der Laan
abaf524f0c Merge #7815: Break circular dependency main ↔ txdb
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
2017-10-19 10:51:12 +02:00
Wladimir J. van der Laan
2e54bd2e8c Merge #7927: Minor changes to dbwrapper to simplify support for other databases
869cf12 dbwrapper: Move `HandleError` to `dbwrapper_private` (Wladimir J. van der Laan)
b69836d dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator (Wladimir J. van der Laan)
878bf48 dbwrapper: Remove CDBWrapper::GetObfuscateKeyHex (Wladimir J. van der Laan)
74f7b12 dbwrapper: Remove throw keywords in function signatures (Wladimir J. van der Laan)
2017-10-19 10:51:06 +02:00
Wladimir J. van der Laan
17f2ea5d73 Merge #7904: txdb: Fix assert crash in new UTXO set cursor
a3310b4 txdb: Fix assert crash in new UTXO set cursor (Wladimir J. van der Laan)
2017-10-19 10:50:59 +02:00
Wladimir J. van der Laan
23fe35a18a Merge #7756: Add cursor to iterate over utxo set, use this in gettxoutsetinfo
509cb00 txdb: Add Cursor() method to CCoinsView to iterate over UTXO set (Wladimir J. van der Laan)
2017-10-19 10:50:25 +02:00
Wladimir J. van der Laan
996f5103a0 Merge #7056: Save last db read
8504867 Save the last unnecessary database read (Alex Morcos)
2017-10-19 10:50:11 +02:00
UdjinM6
4ecbedbe74 fix setnetworkactive (typo) (#1682) 2017-10-17 19:43:03 +03:00
Alexander Block
1df889e231 Add more logging for MN votes and MNs missing votes (#1683)
* Add logging for MNs which did not vote

* Implement review suggestions
2017-10-17 19:42:44 +03:00
Alexander Block
4cac044d95 Merge #8944: Remove bogus assert on number of oubound connections. (#1685)
1ab21cf Remove bogus assert on number of oubound connections. (Matt Corallo)
2017-10-17 19:41:57 +03:00
UdjinM6
46342b2e8a update nCollateralMinConfBlockHash for local (hot) masternode on mn start (#1689) 2017-10-17 19:41:43 +03:00
UdjinM6
f5286b1799 Fix/optimize images (#1688)
* add Dash-specific paths to `folders` in optimize-pngs.py

* `mogrify src/qt/res/*/*/*.png`

should fix "libpng error: IDAT: chunk data is too large"

* `python contrib/devtools/optimize-pngs.py`

"Total reduction: 500275 bytes"
2017-10-17 19:41:28 +03:00
UdjinM6
28c8d17292 Fix sync reset on lack of activity (#1686) 2017-10-17 19:41:08 +03:00
UdjinM6
32ad53e77d Revert "fix masternode current rpc (#1640)" (#1681)
This reverts commit 0c1679e58c.
2017-10-17 19:40:25 +03:00
Alexander Block
2de7560b2f Update nMinimumChainWork and defaultAssumeValid to more recent values (#1680)
* Update nMinimumChainWork and defaultAssumeValid to more recent values

* Update checkpoint data of mainnet to height 750000
2017-10-12 15:05:31 +03:00
UdjinM6
cd47ac3faa fix nLastWatchdogVoteTime updates (#1679) 2017-10-12 15:05:17 +03:00
Holger Schinzel
58f9f9bbec Facelift of splash screens, adding "Digital Cash" tagline (#1674)
* Facelift of splash screens, adding "Digital Cash" tagline

* testnet: green --> orange

* revert drkblue changes
2017-10-12 15:05:00 +03:00
UdjinM6
52cd4d40d8 Fix bug: nCachedBlockHeight was not updated on start (#1673)
in submodules if no new blocks were received since previous shutdown.
This was breaking some sync logic e.g. for payment votes.
2017-10-09 21:25:24 +03:00
UdjinM6
296cfd2efa Fix compilation with qt < 5.2 (#1672)
* Fix compilation with qt < 5.2

* remove code duplication
2017-10-09 21:25:11 +03:00
thephez
ece884994e RPC help formatting updates (#1670)
- Convert satoshis to duffs
 - Correct order of fields in GetAddressUtxos
 - Add missing field from GetAddressDeltas (blockindex)
 - Add HelpExamples to gettxoutproof and verifytxoutproof
2017-10-09 21:24:56 +03:00
UdjinM6
11afd7cfd3 Translations201710 - en, de, fi, fr, ru, vi (#1659)
* fix "InstantSend: Yes/No" in receiving request dlg

* [qt] Add more sources to translate

backport fae26e8dfc

* fix .pro

* fix typo: memonic -> mnemonic

* fix "s(s)"

* `make translate` + qt linguist

* update ru

* update fi

* update de

* update fr

* update vi

* fix ru

* fix de
2017-10-09 21:24:42 +03:00
UdjinM6
0b6955a7b8 update nMinimumChainWork and defaultAssumeValid for testnet (#1668) 2017-10-05 00:01:29 +03:00
UdjinM6
33dbafbba5 fork testnet again to re-test dip0001 because of 2 bugs found in 1st attempt (#1667) 2017-10-04 23:13:32 +03:00
UdjinM6
48d63ab296 Relay govobj and govvote to every compatible peer, not only to the one with the same version (#1662) 2017-10-04 23:12:53 +03:00
UdjinM6
d286198728 fix: The idea behind fDIP0001LockedInAtTip was to indicate that it WAS locked in, not that it IS locked in (#1666) 2017-10-04 22:35:09 +03:00
Ilya Savinov
c3bc06bbf8 fix Examples section of the RPC output for listreceivedbyaccount, listreceivedbyaccount and sendfrom commands (#1665) 2017-10-04 22:34:30 +03:00
Ilya Savinov
8c1e5e8384 remove send addresses from listreceivedbyaddress output (#1664) 2017-10-04 22:34:14 +03:00
UdjinM6
381ffdc4bb Fork testnet to test 12.2 migration (#1660) 2017-10-02 00:02:01 +03:00
UdjinM6
278cf144b3 Remove cs_main from ThreadMnbRequestConnections (#1658) 2017-09-28 15:03:39 +03:00
UdjinM6
f77efcf247 do not calculate stuff that are not going to be visible in simple PS UI anyway (#1656) 2017-09-27 20:43:28 +03:00
UdjinM6
8e9289e12b Keep track of wallet UTXOs and use them for PS balances and rounds calculations (#1655)
* keep track of wallet UTXOs and use them for PS balances and rounds calculations

* fix
2017-09-27 20:43:16 +03:00
UdjinM6
0c1679e58c fix masternode current rpc (#1640)
GetNextMasternodeInQueueForPayment should not filter scheduled massternodes for it
2017-09-27 20:43:03 +03:00
UdjinM6
8c15f5f878 speedup MakeCollateralAmounts by skiping denominated inputs early (#1631) 2017-09-27 20:42:53 +03:00
Ilya Savinov
7a8910443c Fix unlocked access to vNodes.size() (#1654) 2017-09-25 17:16:56 +03:00
crowning-
08e503da28 [GUI] Change look of modaloverlay (#1653)
* [GUI] Change look of modaloverlay

* Update crownium.css

Copy'n'paste error removed
2017-09-25 17:16:48 +03:00
UdjinM6
d07ac4fbd3 fix: update DIP0001 related stuff even in IBD (#1652) 2017-09-22 04:54:14 +03:00
UdjinM6
7efa5e79d7 fix fallback fee (#1649) 2017-09-22 04:53:43 +03:00
UdjinM6
ea793a71f1 Make sure mixing masternode follows bip69 before signing final mixing tx (#1510)
* Make sure mixing tx follows bip69 before signing it

* bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70208
2017-09-22 04:53:15 +03:00
UdjinM6
502748487d bump MIN_INSTANTSEND_PROTO_VERSION to 70208 (#1650) 2017-09-22 04:52:35 +03:00
UdjinM6
72b221f745 Revert "fix BIP68 granularity and mask (#1641)" (#1647)
This reverts commit d3829e55b1.

Reverting and postponing the fix till later. Probably should write a DIP and explore different options first.
2017-09-21 16:58:23 +03:00
Ilya Savinov
b41f8d3dd6 fix instantsend-related RPC output (#1628)
* revert confirmations to its original meaning ("Blockchain Confirmations") and also remove bcconfirmations completely
* add new field instantlock (bool) to the RPC output of gettransaction, listtransactions and listsinceblock commands to indicate that tx was locked via InstantSend
* add optional `addlockconf` in addition to `minconf` parameter to all the commands where it makes sense
* fix `wallet.py` test and `vRPCConvertParams` set
* add addlockconf parameter for listreceivedbyaccount/listreceivedbyaddress commands
2017-09-20 23:34:54 +03:00
UdjinM6
25fa44d5a9 fix DIP0001 implementation (#1639)
According to DIP0001 description we should be using payment queue to select current masternode:
>As a block is mined the version number is determined by the miner who mined it and the masternode that is selected for that block.
>...
>The selection of a round consisting of 4032 blocks is made based on masternodes not being randomly selected, rather they are in a queue.

https://github.com/dashpay/dips/blob/master/dip-0001.md
2017-09-20 23:31:23 +03:00
UdjinM6
cd76f2a15c Disable HD wallet by default (#1629)
* disable hd wallet by default, fix related comments/help strings

* split tests for HD and non-HD cases
2017-09-20 23:31:12 +03:00
UdjinM6
5f0da8aa71 fix sync (#1643) 2017-09-20 23:30:56 +03:00
UdjinM6
d3829e55b1 fix BIP68 granularity and mask (#1641)
fixes https://github.com/dashpay/dash/issues/1552
2017-09-20 23:30:21 +03:00
Alexander Block
7ab175a8e3 Ensure Dash wallets < 0.12.2 can't open HD wallets (#1638) 2017-09-19 17:52:29 +03:00
diego-ab
026ad8421a Fix empty tooltip during sync under specific conditions (#1637)
* Fix empty tooltip during sync under specific conditions

* Move IsBlockchainSynced check
2017-09-19 17:52:10 +03:00
Oleg Girko
753b1e486b Eliminate remaining uses of g_connman in Dash-specific code. (#1635)
This monstrous change eliminates all remaining uses of
g_connman global variable in Dash-specific code.

Unlike previous changes eliminating g_connman use
that were isolated to particular modules, this one covers
multiple modules simultaneously because they are so interdependent
that change in one module was quickly spreading to others.

This is mostly invariant change that was done by
* changing all functions using g_connman to use connman argument,
* changing all functions calling these functions to use connman argument,
* repeating previous step until there's nothing to change.

After multiple iterations, this process converged to final result,
producing code that is mostly equivalent to original one, but passing
CConnman instance through arguments instead of global variable.

The only exception to equivalence of resulting code is that I had to
create overload of CMasternodeMan::CheckAndRemove() method without arguments
that does nothing just for use in CFlatDB<CMasternodeMan>::Dump() and
CFlatDB<CMasternodeMan>::Load() methods.
Normal CMasternodeMan::CheckAndRemove() overload now has argument of
CConnman& type and is used everywhere else.

The normal overload has this code in the beginning:

    if(!masternodeSync.IsMasternodeListSynced()) return;

Masternode list is not synced yet when we load "mncache.dat" file,
and we save "mncache.dat" file on shutdown, so I presume that it's OK
to use overload that does nothing in both cases.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2017-09-19 17:51:38 +03:00
UdjinM6
02e882c3d8 bump MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 and PROTOCOL_VERSION to 70208 (#1636) 2017-09-17 20:43:58 +03:00
UdjinM6
8f850c60fa Lower tx fees 10x (#1632)
* Lower tx fees 10x

* add DEFAULT_DIP0001_*FEE constants
2017-09-17 19:00:44 +03:00
UdjinM6
825b3ccc97 more "vin" -> "outpoint" in masternode rpc output (#1633)
* more "vin" -> "outpoint" in masternode rpc output

* fix doc
2017-09-17 19:00:05 +03:00
UdjinM6
e22453c902 fix fDIP0001* flags initialization (#1625) 2017-09-15 21:08:03 +03:00
UdjinM6
10eddb52de Move some (spamy) CMasternodeSync log messages to new mnsync log category (#1630) 2017-09-15 21:05:28 +03:00
Oleg Girko
4956ba7a7f Eliminate g_connman use in instantx module. (#1626)
Pass reference to CConnman instance to methods of CInstantSend
and other instantsend-related classes instead of using g_connman
global variable there.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2017-09-15 21:05:13 +03:00
Ilya Savinov
adc7c6cb12 Remove some recursive locks (#1624)
* unnecessary recursive lock removed in `VersionBitsTipState` method

* interface changed for CRateChecksGuard; unnecessary recursive lock removed
2017-09-15 21:05:03 +03:00
UdjinM6
d7a8489f31 Fix masternode score/rank calculations (#1620)
* fix CMasternode::CalculateScore, new mn score algo activation is triggered by DIP0001 lock-in

* unify rank calculation, base it on full mn vector rather than using active mns only

* bump CMasternodeMan::SERIALIZATION_VERSION_STRING

* unify rank calculations even further

* fix (partially revert previous one)
2017-09-14 16:58:29 +03:00
Ilya Savinov
6a6b31b74d Dip0001-related adjustments (inc. constants) (#1621)
* block size related constants adjusted; other minor fixes

* revert constants related to storing blocks on disk

* move AssertLockHeld to a separate PR
2017-09-14 14:42:37 +03:00
UdjinM6
5f4362cb82 fix SPORK_5_INSTANTSEND_MAX_VALUE validation in CWallet::CreateTransaction (#1619) 2017-09-14 14:41:58 +03:00
UdjinM6
84ecccefce InstandSend overhaul (#1592)
* InstandSend overhaul
- relay conflicting votes to detect attack earlier and PoSe-ban attacking masternode(s)
- cancel conflicting completed locks
- do not overwrite mempool or reprocess blocks
- 15 sec timeout/window to lock tx

* check nValueIn for SPORK_5_INSTANTSEND_MAX_VALUE (instead of nValueOut)

* relay valid vote asap

* ignore votes for spent coins, consider them invalid
2017-09-14 14:41:40 +03:00
krychlicki
6ff7b7aa54 fix TrafficGraphData bandwidth calculation (#1618)
* recalculate average bandwidth for given range

* tests for bandwidth calculation
2017-09-12 17:33:48 +03:00
UdjinM6
33e460f306 Fix losing keys on PrivateSend (#1616)
* reserve colateral keey only if needed

reserve colateral keey only if needed -> fix losing one key on every
subsequent CreateDonominate

* Adding KeyHolder and KeyHolderStorage

Adding KeyHolder and KeyHolderStorage to store keys used in PrivateSend
until status of mixing is known.

* Removing ClearOn... methods. Instead of calling directly KeepAll/ReplaceAll.

* remove usage of shared_ptr

* use unique_ptr

* follow naming convention

* use CKeyHolderStorage in CreateDenominated too

* adjust log messages

* return keys on POOL_STATE_ERROR, keep keys on POOL_STATE_SUCCESS

* Disable copy/assign and allow move

* Use keyHolderStorageDenom for collateral output in CreateDenominated
2017-09-11 17:14:55 +03:00
UdjinM6
05da4557d0 Refactor masternode management (#1611)
* Store masternodes in a map instead of a vector, drop unused functions in CMasternodeMan

* CTxIn vin -> COutPoint outpoint

* do not use CMasternodeMan::Find outside of the class

* update GetMasternodeInfo

* safe version of GetNextMasternodeInQueueForPayment

* fix ProcessMasternodeConnections

* bump CMasternodeMan::SERIALIZATION_VERSION_STRING
2017-09-11 17:13:48 +03:00
UdjinM6
cd262bf641 DIP0001 implementation (#1594)
* DIP0001 implementation

* add option in ComputeBlockVersion to assume that masternode is upgraded (and skip rank calculation)

* fix mainnet DIP0001 nTimeout

* schedule DIP0001 testnet activation start for Sep 18th, 2017 (bump timeout too)
2017-09-11 17:13:30 +03:00