Commit Graph

15050 Commits

Author SHA1 Message Date
Alexander Block
d6c5a72e2f Basic validation of version 3 TXs in CheckTransaction 2018-08-29 11:36:14 +02:00
Alexander Block
a3c4ee3fda DIP2 changes to CTransaction and CMutableTransaction 2018-08-29 11:36:14 +02:00
Alexander Block
d20100ecd4 DIP0003 deployment 2018-08-29 11:36:14 +02:00
Alexander Block
b6896387ae Move DIP1 transaction size checks out of ContextualCheckBlock and use ContextualCheckTransaction instead (#2238)
* Pass consensus params to ContextualCheckTransaction

As we do with ContextualCheckBlock

* Use ContextualCheckTransaction in ContextualCheckBlock instead of duplicating the check

* Fix pindexPrev parameter signature in ContextualCheckTransaction
2018-08-28 14:43:58 +03:00
Alexander Block
e415fd049a Revert CMasternodePayments::IsTransactionValid to the logic before the recent refactorings (#2237)
partially reverts #2216
2018-08-27 15:48:45 +03:00
Nathan Marley
73c2ddde7a extract sporkmanager from sporkmessage (#2234)
The SporkMessage is a lower-level construct which shouldn't be aware of
SporkManager. This commit moves the `sporkManager.IsSporkActive()` calls
outside the SporkMessage functions. This follows the dependency injection
pattern and makes it easier to test SporkMessage as well.
2018-08-22 17:46:27 +03:00
Alexander Block
8da88ecf68 Don't crash when formatting in logging throws exceptions (#2231)
* Don't crash when formatting in logging throws exceptions

* Preserve exception like output
2018-08-21 18:34:26 +03:00
gladcow
b92bd8997a Fix mninfo search by payee (#2233) 2018-08-21 17:08:42 +03:00
Nathan Marley
2997d6d268 add compressed option to masternode genkey (#2232)
* add compressed option to `masternode genkey`

* use ParseBoolV method

* adjust help message for masternode genkey
2018-08-21 17:08:11 +03:00
PastaPastaPasta
98ed90cbb4 adds rpc calls for setprivatesendrounds and setprivatesendamount (#2230)
* adds rpc calls for `setprivatesendrounds` and `setprivatesendamount`

* tabs -> spaces

* @gladcow change request

* Whops tab -> spaces

* @Udjin changes, not the CAmount -> int

* int stuff

* Throw error when rounds / amount isn't within range
2018-08-21 17:07:54 +03:00
gladcow
2e06f8133f fix missed format parameter (#2229) 2018-08-21 17:07:32 +03:00
Alexander Block
3d654b9814 Build bionic base image in Jenkinsfile.gitian & update docs (#2226)
* Build bionic base image in Jenkinsfile.gitian

We updated gitian builds to use bionic, so we should also update the Jenkinsfile

* Update docs
2018-08-14 22:36:15 +03:00
Alexander Block
50eb98d901 Prepare for DIP3 operator reward payments and switch to array in getblocktemplate (#2216)
* Prepare for DIP3 operator reward payments and switch to array in getblocktemplate

This commit allows to later split MN rewards into multiple recipients, e.g.
the owner reward and operator reward. It also updates the getblocktemplate
output to return an array of MN payments instead of a single entry.

This should allow MN miners and pool operators to prepare themself for the
upcoming changes in regard to operator rewards.

* txoutsMasternode -> voutMasternode

* More renaming

* Consider all masternode payments when looking for a known masternode
2018-08-14 12:58:38 +03:00
Alexander Block
c09f57bd78 Backport move to Ubuntu Bionic and GCC7 in Gitian builds (#2225)
* Add stdin, stdout, stderr to ignored export list

* Merge #13171: Change gitian-descriptors to use bionic instead

c1afe3232fa10e290fb355cf37ea4c7bc1084065 Change gitian-descriptors to use bionic instead (Chun Kuan Lee)

Pull request description:

  I have tested this with Ubuntu Bionic host with lxc 3.0.0, the gitian-build for Windows and MacOSX work fine, but there is an issue about it for Linux. Failed at check-symbol:
  ```
  test/test_bitcoin: symbol __divmoddi4 from unsupported version GCC_7.0.0
  test/test_bitcoin: symbol log2f from unsupported version GLIBC_2.27
  qt/bitcoin-qt: symbol __divmoddi4 from unsupported version GCC_7.0.0
  qt/bitcoin-qt: symbol log2f from unsupported version GLIBC_2.27
  ```
  I think this should be fixed in `./configure --enable-glibc-back-compat`

  Should not be merged before #13177 devrandom/gitian-builder#178

  Close #12511

Tree-SHA512: 257d75d5b6864e105279f7a7b992fbbd7903cdbe3300b66dacec0a783d267707d9dbbfe0e64a36983ca1eca50a2a5e1cdb222b6d3745ccc3e5fc5636c88b581f

* Use IN6ADDR_ANY_INIT instead of in6addr_any

This is the same fix as fc6a9f2ab1
Couldn't backport the original commit as we are missing some refactorings.
2018-08-13 23:21:42 +03:00
gladcow
1767e3457e Save/load spork cache (#2206)
* CSporkManager class serialization

* Read/write sporks.dat file

* Move mapSporks into CSporkManager and serialize it

* fix GetSporkByHash

* spork tests

* add missed cs lock

* clear mapSporksByHash in CSporkManager::Clear

* use spork active rpc call to hide spork inner logic

* set small pause between rpc calls in cycles
2018-08-13 23:21:21 +03:00
Alexander Block
7cf9572c26 Backport Bitcoin #11881: Remove Python2 support (#2224)
* Merge #11881: Remove Python2 support

1874058 Make base58 python contrib code work with python3 (Evan Klitzke)
bc6fdf2 Change all python files to use Python3 (John Newbery)

Pull request description:

  Following discussion here: https://github.com/bitcoin/bitcoin/pull/11843#issuecomment-351033742

  It's easier for maintainers if all python tools/scripts support only a single version of Python. There are only a few scripts that aren't explicitly python3 at this point, so this PR changes those remaining scripts to explicitly require python3.

Tree-SHA512: 5d38eef6e0fc7d8515e23a1f4c75e8b4160fd0fe23cba52a1f41689b114e54a9e503e0724829e8b41982ef98f2d113df80d9e238213b74f09ceaed0344a19e24

* Merge #12829: Python3 fixup

f50975b [contrib] fixup symbol-check.py Python3 support (John Newbery)
5de2b18 [contrib] fixup security-check.py Python3 support (John Newbery)

Pull request description:

  security-check.py and symbol-check.py were broken by #11881. Fix them.

Tree-SHA512: 86de3d6dc3292b1ae4cc04c2d7d7dbbf39c9270551d7b224b8d8b19e3184c30c897dbf823200403706d06bb405c0decad5cfd690cb2c0312992a235a4ffcf6bf
2018-08-13 19:07:52 +03:00
Alexander Block
4d3518fe04 Refactor MN payee logic in preparation for DIP3 (#2215)
* Refactor block payee filling/validation

1. Move out old budget validation into it's own function (IsOldBudgetBlockValueValid)
2. Refactor IsBlockValueValid to bail out early instead of using deep
   nested if/else blocks. IMHO, I feel that this makes the code much easier
   to read and less error prone.
3. Refactor/rename CreateSuperblock and CMasternodePayments::FillBlockPayee
   to be getters without actually modifying the coinbase TX. The coinbase
   is now only modified from the global FillBlockPayments function. Makes
   later changes in DIP3 easier (allowing superblock and MN rewards in same block)

* Use __func__ for logging in block payee code

* Fix code style nit
2018-08-12 18:27:09 +03:00
Alexander Block
d946f21bd9 Masternode related refactorings in preparation of DIP3 (#2212)
* Split CActiveMasternode into CActiveMasternodeInfo and CLegacyActiveMasternodeManager

* Use CKeyID instead of CPubKey whenever possible in masternode code

* Rename activeMasternode to activeMasternodeInfo and make it a struct

* Rename pubKeyIDXXX to keyIDXXX

* Bump SERIALIZATION_VERSION_STRING

* Fix build error after rebase

* Fix compilation warning/error with clang
2018-08-11 22:55:56 +03:00
Alexander Block
633879cd28 Only use version 1 and 2 transactions for sighash_tests (#2219)
Also regenerated sighash.json with the help of PRINT_SIGHASH_JSON
2018-08-11 01:36:36 +03:00
Alexander Block
2d4e18537c Some useful commits from the DIP3 PR in regard to integration tests (#2218)
* Allow changing budget parameters for regtest

* Lift some limitations for local addresses for masternodes in regtest

Needed to make masternodes works in regtest mode

* Add "masternode check" RPC to force invocation of CheckAndRemove

Useful in integration tests where MN lists must be predictable
2018-08-11 01:36:17 +03:00
Alexander Block
a959f60aa7 De-duplicate "gobject vote-alias" and "gobject "vote-many" code (#2217)
Use same code for both vote modes
2018-08-11 01:35:52 +03:00
Alexander Block
075ca0903f Protect CSporkManager with critical section (#2213) 2018-08-11 01:34:28 +03:00
Alexander Block
106bab1ae1 Add new ParseXXX methods to easily parse UniValue values (#2211) 2018-08-11 01:33:56 +03:00
Alexander Block
566fa5ec3b Add support for "help command subCommand" (#2210) 2018-08-11 01:30:55 +03:00
Alexander Block
c4c6107839 Use C++14 standard when building (#2209)
We have upgraded CI to use a recent compiler already and thus can also
increase the C++ standard now. After this, we'll also have to update
Gitian build to work with C++14 as well, but this is going to happen in
separate commits/PRs.
2018-08-11 01:29:28 +03:00
strophy
589a77013f Correction to release date for 0.12.0 (#2205)
Dash 0.12.0 went through several releases for testnet, so the first public release for mainnet was 0.12.0.44 on 15 August 2015.
https://www.dash.org/forum/threads/v12-release.5888/
https://github.com/dashpay/dash/tags?after=v0.12.0.48
2018-08-11 01:29:02 +03:00
UdjinM6
4cd969e3d2
Add previousbits field to getblocktemplate output (#2201)
* Add `previousbits` field to `getblocktemplate` output

* add comment to nPrevBits
2018-08-11 01:28:30 +03:00
UdjinM6
c4ee2c89ef
Fix mnsync in regtest (#2202) 2018-08-04 16:39:15 +03:00
strophy
d4d11476aa Fix typo and grammar in PS error message (#2199)
* Fix typo

* Grammar fix
2018-08-04 16:38:57 +03:00
UdjinM6
6bcd868de7
Fix lockedByInstantSend initialization (#2197) 2018-07-29 09:39:37 +03:00
gladcow
0a6f47323b Remove dummy confirmations in RPC API and GUI for InstantSend transactions (#2040)
* remove instandsenddepth option

* remove CInstantSend::GetConfirmations

* Explicit IXlocks processing in the code using GetDepthInMainChain

* remove dummy confirmations for IX locks

* remove unused constant

* Track IS status in TransactionStatus

* Highlight IS in tx list

* Customize confirmation icons for IS txes

* Fix issues:

- bring back removed comment;
- simplify 2 complex condition to ose `IsTrusted()` function only;
- rename `IsLockedIX` function to 'IsLockedByInstantSend`;

* Revert condition with IsTrusted()

* code style fix

* remove dummy confirmations from instantsend.md

* fix instantsend.md
2018-07-28 19:39:37 +03:00
UdjinM6
a83ab55010
Fix wallet lock check in DoAutomaticDenominating (#2196) 2018-07-28 16:51:45 +03:00
UdjinM6
96435288fa
Move block template specific stuff from CBlock to CBlockTemplate (#2195) 2018-07-28 16:51:29 +03:00
UdjinM6
3d002c9463
Fix active masternode task schedule (#2193) 2018-07-28 16:51:13 +03:00
UdjinM6
ac30196bc5
Show some info about the wallet dumped via dumpwallet (#2191)
Also show a warning that the file must be kept secure.
2018-07-28 16:50:58 +03:00
UdjinM6
30fa8bc33c
Make sure pwalletMain is not null whenever it's used in PS client (#2190)
* Make sure pwalletMain is not null whenever it's used in PS client

* partially revert
2018-07-28 16:50:41 +03:00
UdjinM6
65b9045269
Add helpers GetSentinelString() and GetDaemonString() to CMasternodePing (#2192) 2018-07-25 18:09:48 +03:00
UdjinM6
a5643f899d
Switch RequestGovernanceObjectVotes from pointers to hashes (#2189)
* No need for pointers to gobjects, can simply use hashes in RequestGovernanceObjectVotes

* Drop `swap` and `=` in GovernanceObject

Were used for shuffling, no longer needed
2018-07-25 18:09:30 +03:00
Alexander Block
eb202e812f Use ccache in gitian builds (#2185)
* Use subdirectory for depends cache in gitian builds

* Make timestamps of wrappers deterministic

* Use ccache in gitian builds

* Upgrade ccache to latest version (3.4.2)

* Build the branch that belongs to the Jenkins build instead of develop
2018-07-20 16:33:02 +03:00
gladcow
ace980834f Extend Bloom Filter support to InstantSend related messages (#2184)
* use bloom filters for IX lock votes

* code style fixes
2018-07-20 16:32:41 +03:00
Alexander Block
b476173258 Install python3 in gitian builds (#2182)
We mostly switched to python3, so we should also install it in gitian
builds. Especially the osx build needs as it otherwise fails due to
missing setuptools.
2018-07-16 15:49:23 +03:00
Alexander Block
7a85e24c37 Remove deprecated gitian-rpi2.yml descriptor (#2183)
Since backporting Bitcoin 0.14 code, we have the arm-linux-gnueabihf
and aarch64-linux-gnu hosts in gitian-linux.yml
2018-07-16 15:48:47 +03:00
PaulieD
d7e2103411 Fixes inaccurate round count in CoinControlDialog (#2137)
* fixes #2068

* Revert prior and update in correct location
2018-07-16 15:48:02 +03:00
UdjinM6
1681d6366f
Replace Dash-specific threads with Dash-specific scheduled tasks (#2043)
* Replace Dash-specific threads with scheduled tasks

* Fix rare crash when trying to shutdown wallet during mixing

Should stop PS and release all keys _before_ wallet is destroyed.

* fix nowallet

* update doc
2018-07-16 15:47:37 +03:00
Nathan Marley
dac090964f remove dashpay.io dns seed entry (#2181) 2018-07-13 13:00:55 +03:00
Alexander Block
753c2436bd Fix MissingPropertyException on Jenkins when no cache was found (#2180) 2018-07-12 18:43:20 +03:00
Alexander Block
f3e380659a Move to in-docker CI builds and add Jenkins support (#2178)
* GCC-7 and glibc-2.27 compat code

* Statically link libstdc++ for GCC based builds

Makes sure binaries which are built on a newer build host still work
on older distros.

* Use python3 when installing MacOS native tools

* Move actual build logic out of Travis and upgrade to gcc-7

Travis will now simply call a few scripts which do the actual work.
These scripts will first create a "builder image" which contains the
necessary environment for the actual build. Then scripts are called
inside this builder image to do the build.

This should make us more independant from Travis and also allows us
to do local CI testing.

The build matrix is also moved out of .travis.yml and instead moved
into ci/matrix.sh. This script is sourced with only "BUILD_TARGET" being
set so that it internally can figure out which other environment
variables need to be set.

This commit also upgrades the used GCC version to 7. This is due to the
use of ubuntu:bionic as base image for the builder image.

* Add Jenkinsfiles for regular CI and nightly gitian builds

* Automatically download OSX SDK in gitian-build.sh

* Remove bogus "export MAKEJOBS=-j5"

* Forward cache/src dirs into builder container

Fixes caching issues on Travis.

* fix

* Fail build immediately when building depends took too long
2018-07-12 16:28:59 +03:00
Alexander Block
23dde9f12b Remove a few annoying debug prints from CMasternodeMan (#2179)
These are occurring every second and cause more noise than actual
information.
2018-07-12 12:17:19 +03:00
Oleg Girko
5036d7dfc5 depends: Update Qt download url (#2177) 2018-07-12 12:09:02 +03:00
Nathan Marley
e23339d6f0 use nullptr in Dash-specific code (#2166)
This is recommended in modern C++ code as nullptr is more type-safe and can't
be converted to an integer, unlike NULL.
2018-07-12 12:08:43 +03:00