Commit Graph

13437 Commits

Author SHA1 Message Date
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
UdjinM6
98990b683a Refactor: CDarkSendSigner (#1410)
* Refactor: CDarkSendSigner -> CMessageSigner + CMasternodeBroadcast::IsVinAssociatedWithPubkey

* move IsVinAssociatedWithPubkey to CMasternode

* static IsVinAssociatedWithPubkey -> no params IsInputAssociatedWithPubkey
2017-04-12 10:04:06 +03:00
Oleg Girko
f3b92a95d9 c++11: don't throw from the reverselock destructor (#1421)
noexcept is default for destructors as of c++11. By throwing in reverselock's
destructor if it's lock has been tampered with, the likely result is
std::terminate being called. Indeed that happened before this change.

Once reverselock has taken another lock (its ctor didn't throw), it makes no
sense to try to grab or lock the parent lock. That is be broken/undefined
behavior depending on the parent lock's implementation, but it shouldn't cause
the reverselock to fail to re-lock when destroyed.

To avoid those problems, simply swap the parent lock's contents with a dummy
for the duration of the lock. That will ensure that any undefined behavior is
caught at the call-site rather than the reverse lock's destruction.

Barring a failed mutex unlock which would be indicative of a larger problem,
the destructor should now never throw.
2017-04-11 13:55:41 +03:00
UdjinM6
8bbcf62000 Fixed pow (test and algo) (#1415)
* Extend pow test to actually check DGW3 diff adjustment

* Refactor pow
2017-04-11 13:55:07 +03:00
UdjinM6
68e1a8c790 Safety check in CInstantSend::SyncTransaction (#1412) 2017-04-11 13:54:34 +03:00
UdjinM6
5758ae1bfc Full path in "failed to load cache" warnings (#1411) 2017-04-11 13:54:17 +03:00
UdjinM6
ff30aed68f Align with btc 0.12 (#1409)
* Implement BIP 9 GBT changes

- BIP9DeploymentInfo struct for static deployment info
- VersionBitsDeploymentInfo: Avoid C++11ism by commenting parameter names
- getblocktemplate: Make sure to set deployments in the version if it is LOCKED_IN
- In this commit, all rules are considered required for clients to support

* qa/rpc-tests: bip9-softforks: Add tests for getblocktemplate versionbits updates

* getblocktemplate: Explicitly handle the distinction between GBT-affecting softforks vs not

* getblocktemplate: Use version/force mutation to support pre-BIP9 clients

* Don't use floating point

Github-Pull: #8317
Rebased-From: 477777f250

* Send tip change notification from invalidateblock

This change is needed to prevent sync_blocks timeouts in the mempool_reorg
test after the sync_blocks update in the upcoming commit
"[qa] Change sync_blocks to pick smarter maxheight".

This change was initially suggested by Suhas Daftuar <sdaftuar@chaincode.com>
in https://github.com/bitcoin/bitcoin/pull/8680#r78209060

Github-Pull: #9196
Rebased-From: 67c6326abd

* torcontrol: Explicitly request RSA1024 private key

When generating a new service key, explicitly request a RSA1024 one.

The bitcoin P2P protocol has no support for the longer hidden service names
that will come with ed25519 keys, until it does, we depend on the old
hidden service type so make this explicit.

See #9214.

Github-Pull: #9234
Rebased-From: 7d3b627395

* Bugfix: FRT: don't terminate when keypool is empty

Github-Pull: #9295
Rebased-From: c24a4f5981

* add fundrawtransaction test on a locked wallet with empty keypool

Github-Pull: #9295
Rebased-From: 1a6eacbf3b
2017-04-11 13:53:54 +03:00
UdjinM6
4595db0ce3 Few changes for governance rpc: (#1351)
- allow filtering by all signals in `list`
- do not count/print funding votes for watchdogs
2017-04-11 13:53:13 +03:00
UdjinM6
7a5943c3a2 Merge pull request #1431 from dashpay/v0.12.2.x-merge_upstream
V0.12.2.x merge upstream
2017-04-11 13:50:56 +03:00
Holger Schinzel
b815a7b6a3 Merge remote-tracking branch 'remotes/origin/master' into v0.12.2.x
# Conflicts:
#	configure.ac
#	src/clientversion.h
2017-04-11 11:19:18 +02:00
Tim Flynn
86525601d5 V0.12.1.x multiple wd rate check (#1426)
* Modify MasternodeRateCheck to support updating buffers only on failure

* Update rate check buffer only when fAddToSeen is true
2017-04-05 19:30:08 +03:00