Commit Graph

13397 Commits

Author SHA1 Message Date
Oleg Girko
f65017cfeb Backport Bitcoin PR#7349: Build against system UniValue when available (#1503)
* Build against system UniValue when available

* doc: Add UniValue to build instructions

* Bugfix: The var is LIBUNIVALUE,not LIBBITCOIN_UNIVALUE

* Change default configure option --with-system-univalue to "no"

* Bugfix: Always include univalue in DIST_SUBDIRS

* LDADD dependency order shuffling

* build-unix: Update UniValue build conditions
2017-07-04 06:20:19 +03:00
UdjinM6
96f0d6ec2b various trivial cleanup fixes (#1501) 2017-07-03 16:14:07 +03:00
Oleg Girko
b0843c397c Backport Bincoin PR#7348: MOVE ONLY: move rpc* to rpc/ + same for Dash-specific rpc (#1502) 2017-07-03 16:13:34 +03:00
UdjinM6
549b659e8c Force self-recheck on CActiveMasternode::ManageStateRemote() (#1441)
(otherwise code below could fail if we received new mnb right after latest check and thus our MN will not start)
2017-07-01 22:00:40 +03:00
Oleg Girko
a12491448d Eliminate unnecessary call to CheckBlock (#1498)
ProcessNewBlock would return failure early if CheckBlock failed, before
calling AcceptBlock.  AcceptBlock also calls CheckBlock, and upon failure
would update mapBlockIndex to indicate that a block was failed.  By returning
early in ProcessNewBlock, we were not marking blocks that fail a check in
CheckBlock as permanently failed, and thus would continue to re-request and
reprocess them.
2017-07-01 21:57:28 +03:00
UdjinM6
029ee64948 split CPrivateSend (#1492)
* split CPrivateSend:
- common client/server base data structures/functions: CPrivateSendBase
- singleton-like helper: CPrivateSend

* GetCollateralAmount(), more of GetSmallestDenomination()

* refactor GetDSTX

* remove excessive static_cast<bool>

* bring back LOCK(cs_mapdstx) :)

* address review comments

* fix bool operator
2017-06-30 21:30:16 +03:00
Oleg Girko
f9730cb2ec Increase test coverage for addrman and addrinfo (#1497)
Adds several unittests for CAddrMan and CAddrInfo.
Increases the accuracy of addrman tests.
Removes non-determinism in tests by overriding the random number generator.
Extracts testing code from addrman class to test class.
2017-06-30 21:29:29 +03:00
Oleg Girko
a443d4e2d0 Backport Bitcoin PRs #6589, #7180 and remaining part of #7181: enable per-command byte counters in CNode (#1496)
* log bytes recv/sent per command

* net: Account for `sendheaders` `verack` messages

Looks like these were forgotten in #6589.

* Backport remaining part of Bitcoin PR bitcoin/bitcoin#7181.

Most of this PR is already merged, but a small part remaining
that makes per-command byte counts in CNode working.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2017-06-29 04:51:10 +03:00
Alexander Block
1d67d52122 Don't try to create empty datadir before the real path is known (#1494)
Fixes: #1345

The actual problem is that GetDataDir has the side effect of creating the
datadir, even if it is not known yet where it really is. This is only
known after reading the config file or when explicitly specified in the
cmd line.

Thus, if GetDataDir gets called before the datadir value from the config
is read, it tries to create it at the default location.
2017-06-26 16:57:16 +03:00
thephez
5d27950296 Documentation: Add spork message / details to protocol-documentation.md (#1493)
* Protocol doc update - add missing command placeholders
Add spork command details

* Add message type for ssc and govsync

* Typo fixes

* Integrate UdjinM6's suggestions
2017-06-26 16:56:52 +03:00
Tim Flynn
a109a611f3 Validate proposals on prepare and submit (#1488)
* Implement proposal validation

Includes commits:
  Implemented CProposalValidator

  Use CProposalValidator to check proposals at prepare and submit stages

  Modify proposal validator to support numerical data in string format

  Multiple bug fixes in governance-validators.cpp

  Fixed bug in CheckURL

  Fixed stream state check

  Increase strictness of payment address validation for compatibility with sentinel

  Improved error reporting

  Implemented "check" rpc command to validate proposals

  Fixes to RPC check command

  Fix error message

  Unit test and data files for proposal validator

  Added test cases

  Removed debugging code

* Fix name validation

* Changes to address code review comments
2017-06-26 16:56:29 +03:00
Will Wray
7155043571 Dashify bitcoin unix executables (#1486) 2017-06-06 02:47:46 +03:00
Spencer Lievens
72fbfe93d8 Icon Cutoff Fix (#1485)
This will prevent the cutoff of the connections icon when using this theme.
2017-06-06 02:47:36 +03:00
UdjinM6
bea548c612 adjust/fix some log and error messages (#1484)
* adjust/fix some log and error messages

* revert penalty

* more newline/c_str fixes

* lld -> llu
2017-06-06 02:47:23 +03:00
UdjinM6
2daea77a5b fix calculation of (unconfirmed) anonymizable balance (#1477)
* fix calculation of (unconfirmed) anonymizable balance

* store cache with the same param combination as in use
2017-06-06 02:47:12 +03:00
UdjinM6
a28fa724c2 fix BIP34 starting blocks for mainnet/testnet (#1476) 2017-06-06 02:46:58 +03:00
UdjinM6
adf97e12ab fix travis ci mac build (#1483) 2017-05-31 06:50:27 +03:00
Spencer Lievens
b6804678f2 Minor Warning Fixed (#1482)
Follow up to #1405
2017-05-31 06:50:16 +03:00
sorin-postelnicu
ee4daed835 Added clarifications in INSTALL readme for newcomers (#1481)
Added clarifications in order to avoid that newcomers encounter this error when trying to build:
configure: error: libdb_cxx headers missing, Dash Core requires this library for wallet functionality

(see issue https://github.com/dashpay/dash/issues/1442 )
2017-05-31 06:50:03 +03:00
UdjinM6
5988e1e7f5 Increase minimum debug.log size to 10MB after shrink. (#1480) 2017-05-31 06:49:22 +03:00
UdjinM6
fc406f2d82 track asset sync time (#1479) 2017-05-31 06:49:09 +03:00
UdjinM6
62963e9111 fix sync reset which is triggered erroneously during reindex (#1478) 2017-05-31 06:48:47 +03:00
UdjinM6
27f3218de9 HD wallet (#1405)
* HD wallet

Minimal set of changes (no refactoring) backported from Bitcoin upstream to make HD wallets work in Dash 0.12.1.x+

* minimal bip44 (hardcoded account and change)

* minimal bip39

Additional cmd-line options for new wallet:
-mnemonic
-mnemonicpassphrase

* Do not recreate HD wallet on encryption

Adjusted keypool.py test

* Do not store any private keys for hd wallet besides the master one

Derive all keys on the fly.
Original idea/implementation - btc PR9298, backported and improved

* actually use bip39

* pbkdf2 test

* backport wallet-hd.py test

* Allow specifying hd seed, add dumphdseed rpc, fix bugs

- -hdseed cmd-line param to specify HD seed on wallet creation
- dumphdseed rpc to dump HD seed
- allow seed of any size
- fix dumpwallet rpc bug (wasn't decrypting HD seed)
- print HD seed and extended public masterkey on dumpwallet

* top up keypool on HD wallet encryption

* split HD chain: external/internal

* add missing cs_wallet lock in init.cpp

* fix `const char *` issues (use strings)

* default mnemonic passphrase is an empty string in all cases

* store mnemonic/mnemonicpassphrase

replace dumphdseed with dumphdinfo

* Add fCrypted flag to CHDChain

* prepare internal structures for multiple HD accounts

(plus some code cleanup)

* use secure allocator for storing sensitive HD data

* use secure strings for mnemonic(passphrase)

* small fix in GenerateNewHDChain

* use 24 words for mnemonic by default

* make sure mnemonic passphrase provided by user does not exceed 256 symbols

* more usage of secure allocators and memory_cleanse

* code cleanup

* rename: CSecureVector -> SecureVector

* add missing include

* fix warning in rpcdump.cpp

* refactor mnemonic_check (also fix a bug)

* move bip39 functions to CMnemonic

* Few fixes for CMnemonic:
- use `SecureVector` for data, bits, seed
- `Check` should return bool

* init vectors with desired size where possible
2017-05-29 14:51:40 +03:00
krychlicki
68e858f8dd PrivateSend: dont waste keys from keypool on failure in CreateDenominated (#1473)
* dont waste keys from keypool on failure in CreateDenominated

* bug fix - log actual number of total outputs, comment error

* log number of total outputs as separate value

* add lock so no one can spend outputs used for denominations
2017-05-28 16:50:07 +03:00
krychlicki
18c83f58e3 Qt: bug fixes and enhancement to traffic graph widget (#1429)
* clear trafficgraph on clear button click

* set default sample height

set default sample height so after clearing traffic graph have some
scale

* reduce available traffic graph ranges, add optimized graph data storage

reduce available traffic graph ranges to 10
(5m,10m,15m,30m,1h,2h,3h,6h,12h,24h),
store graph data so range change is possible,
data storage contains only necessary data to create graphs for all
supported ranges
eg. for 10m range storage only half of 10m samples - the second half is
calculated from 5m range samples,
encapsulate all traffic graph related data into one class

* code formatting corrections
2017-05-28 16:49:34 +03:00
Oleg Girko
28a1d0ecc1 Fix the same header included twice. (#1474)
The rpcserver.h header file is included twice as a result of
changes merged from Bitcoin 2 years ago
(commit 64eebc3316).
Include this file just once.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2017-05-26 05:27:07 +03:00
UdjinM6
11121747b8 build: fix qt5.7 build under macOS (#1469)
OBJCXX's std flags don't get defined by our cxx macro. Rather than hard-coding
to c++11, just force OBJCXX to be the same as CXX unless the user specified
otherwise.
2017-05-12 01:01:03 +03:00
Jeremy Rubin
11afc8f4ba Minimal fix to slow prevector tests as stopgap measure 2017-05-12 00:58:36 +03:00
fanquake
7f87754094 Boost 1.63.0 2017-05-12 00:58:36 +03:00
fanquake
be968206bb Boost 1.61.0 2017-05-12 00:58:36 +03:00
Wladimir J. van der Laan
258ed119ab auto_ptr → unique_ptr
Change the few occurrences of the deprecated `auto_ptr` to c++11 `unique_ptr`.
Silences the deprecation warnings.

Also add a missing `std::` for consistency.
2017-05-12 00:58:36 +03:00
Spencer Lievens
c0450f609c Improve EncodeBase58/DecodeBase58 performance (#1456)
* Improve DecodeBase58 performance

* Improve EncodeBase58
2017-05-09 20:06:51 +03:00
Tim Flynn
634ef6c06e Fix for build on Ubuntu 14.04 with system libraries (#1467)
* c++11: detect and correct for boost builds with an incompatible abi

This is ugly, but temporary. boost::filesystem will likely be dropped soon
after c++11 is enabled. Otherwise, we could simply roll our own copy_file. I've
fixed this at the buildsystem level for now in order to avoid mixing in
functional changes.

Explanation:
If boost (prior to 1.57) was built without c++11, it emulated scoped enums
using c++98 constructs. Unfortunately, this implementation detail leaked into
the abi. This was fixed in 1.57.

When building against that installed version using c++11, the headers pick up
on the native c++11 scoped enum support and enable it, however it will fail to
link. This can be worked around by disabling c++11 scoped enums if linking will
fail.

Add an autoconf test to determine incompatibility. At build-time, if native
enums are being used (a c++11 build), and force-disabling them causes a
successful link, we can be sure that there's an incompatibility and enable the
work-around.

* c++11: add scoped enum fallbacks to CPPFLAGS rather than defining them locally

Due to include ordering, defining in one place was not enough to ensure correct
usage. Use global defines so that we don't have to worry abou this ordering.

Also add a comment in configure about the test.

* Remove unneeded include that was added by bitcoin commits
2017-05-09 20:06:17 +03:00
Spencer Lievens
72176e5018 Remove duplicate bantablemodel.h include (#1446) 2017-05-05 14:35:34 +03:00
Spencer Lievens
b7822464f6 Remove unnecessary LOCK(cs_main) in getrawpmempool (#1452) 2017-05-05 14:35:05 +03:00
Spencer Lievens
3efcb755e3 Do not shadow LOCK's criticalblock variable for LOCK inside LOCK (#1453) 2017-05-05 14:34:54 +03:00
Spencer Lievens
f24efd4839 Generate auth cookie in hex instead of base64 (#1454) 2017-05-05 14:34:34 +03:00
Spencer Lievens
e99dbe6208 Don't return the address of a P2SH of a P2SH (#1455) 2017-05-05 14:34:22 +03:00
Spencer Lievens
b272ae56a6 Avoid ugly exception in log on unknown inv type (#1457) 2017-05-05 14:33:58 +03:00
Spencer Lievens
8572d54a98 trivial: fix bloom filter init to isEmpty = true (#1458) 2017-05-05 14:33:44 +03:00
Spencer Lievens
c4fe229008 Access WorkQueue::running only within the cs lock. (#1460)
This removes a race between Interrupt() and Run()
2017-05-05 14:33:26 +03:00
Spencer Lievens
e30faab6fd Make strWalletFile const (#1459)
* Make strWalletFile const

* Insert Line Space for Legibility
2017-05-05 14:31:25 +03:00
Allan Doensen
9901cf4338 Fix for dash-qt issue with startup and multiple monitors. (#1461)
* Fix for issues with startup and multiple monitors on windows.

* Improvements to centering code after a suggestion from zander.
2017-05-05 14:28:40 +03:00
Will Wray
82a4643135 Doc: fix broken formatting in markdown #headers (#1462)
* Doc: fix broken formatting in markdown #headers

Insert a space in markdown headers between the #'s and the header text.
(It appears that the space is required since a github update a year ago
https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0)

* Update REST-interface.md

* Update guide-startmany.md

* Update instantsend.md

* Update keepass.md

* Update release-process.md
2017-05-05 14:28:08 +03:00
Oleg Girko
39750439bf Force to use C++11 mode for compilation (#1463)
* build: Enable C++11 build, require C++11 compiler

Implements #6211.

* depends: use c++11

* build: update ax_cxx_compile_stdcxx to serial 4

* build: force a c++ standard to be specified

Newer compilers may switch to newer standards by default. For example, gcc6
uses std=gnu++14 by default.

* c++11: fix libbdb build against libc++ in c++11 mode

atomic_init clashes with

* c++11: CAccountingEntry must be defined before use in a list

c++11ism. This fixes builds against libc++.
2017-05-05 14:27:27 +03:00
UdjinM6
7242e29228 Refactor PS (#1437)
* split CDarksendPool

* split DoAutomaticDenominating

* CMasternode* -> masternode_info_t

* move some globals into CPrivateSendClient

* addressed PR comments
2017-05-05 14:26:27 +03:00
chaeplin
411332f94b sentinel uses status of funding votes (#1440) 2017-04-23 11:00:11 +03:00
UdjinM6
559f8421b1 Few fixes for PrivateSend (#1408)
* PS should limit entry size, not mixing amount

* There should be no fee in mixing tx

* make sure pwalletMain is not null in PrepareDenominate

*  no need for "double" in GetAverageAnonymizedRounds, "float" should be enough

* add strErrorRet
2017-04-20 23:34:47 +03:00
UdjinM6
6067896aec mix inputs with highest number of rounds first (#1248) 2017-04-20 23:34:35 +03:00
Oleg Girko
b40f8f333c Rename bitcoinconsensus library to dashconsensus. (#1432)
All names containing bitcoinconsensus remaned to contain dashconsensus.
This is needed to avoid conflicts with real bitcoinconsensus library
shipped with Bitcoin Core.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2017-04-15 09:29:09 +02:00