Commit Graph

18068 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
da0042972b
Merge #12336: Remove deprecated rpc options
db1cbcc [RPC] Remove deprecated addmultisigaddress return format (John Newbery)
cb28a0b [RPC] Remove deprecated createmultisig object (John Newbery)
ed45c82 [tests] Remove test for deprecated createmultsig option (John Newbery)
d066a1c [rpc] Remove deprecated getmininginfo RPC option (John Newbery)
c6f09c2 [rpc] remove deprecated estimatefee RPC (John Newbery)
a8e437a [tests] Remove estimatefee from rpc_deprecated.py test (John Newbery)
a5623b1 [tests] Remove tests for deprecated estimatefee RPC (John Newbery)
d119f2e [tests] Fix style warnings in feature_fee_estimation.py (John Newbery)

Pull request description:

  There were some RPC/RPC options deprecated in v0.16. Those can now be removed from master since v0.16 has been branched.

  - `estimatefee` RPC has been removed. The `feature_fee_estimation.py` test has been updated to remove the RPC, but doesn't yet have good coverage of the replacement RPC `estimatesmartfee`. Improving the test coverage should be done in a new PR. (#11031)
  - the `errors` field returned by `getmininginfo` has been deprecated and replaced by a `warning` field. (#10858)
  - providing addresses as inputs to `createmultisig` has been deprecated. Users should use `addmultisigaddress` instead (#11415)
  - The return format from `addmultisigaddress` has changed (#11415)

  `getwitnessaddress` was also deprecated in v0.16 and can be removed, but many tests are using that RPC, so it's a larger job to remove. It should be removed in a separate PR (possibly after #11739 and #11398 have been merged and the segwit test code tidied up)

Tree-SHA512: 8ffaa5f6094131339b9e9e468e8b141de4b144697d2271efa2992b80b12eb97849ade3da8df5c1c9400ed4c04e6a029926550a3e5846d2029b644f9e84ac7124
2020-06-10 18:32:43 -05:00
Jonas Schnelli
fe6b44d228
Merge #12287: Optimise lock behaviour for GuessVerificationProgress()
90ba2df11 Fix missing cs_main lock for GuessVerificationProgress() (Jonas Schnelli)

Pull request description:

  `GuessVerificationProgress()` needs `cs_main` due to accessing the `pindex->nChainTx`.
  This adds a `AssertLockHeld` in `GuessVerificationProgress()` and adds the missing locks in...
  * `LoadChainTip()`
  * `ScanForWalletTransactions()` (got missed in #11281)
  * GUI, `ClientModel::getVerificationProgress()` <--- **this may have GUI performance impacts**, but could be relaxed later with a cache or something more efficient.

Tree-SHA512: 13302946571422375f32af8e396b9d2c1180f2693ea363aeba9e98c8266ddec64fe7862bfdcbb5a93a4b12165a61eec1e51e4e7d7a8515fa50879095dc163412
2020-06-10 18:32:43 -05:00
MarcoFalke
26ca61ec21
Merge #10498: Use static_cast instead of C-style casts for non-fundamental types
9ad6746ccd Use static_cast instead of C-style casts for non-fundamental types (practicalswift)

Pull request description:

  A C-style cast is equivalent to try casting in the following order:

  1. `const_cast(...)`
  2. `static_cast(...)`
  3. `const_cast(static_cast(...))`
  4. `reinterpret_cast(...)`
  5. `const_cast(reinterpret_cast(...))`

  By using `static_cast<T>(...)` explicitly we avoid the possibility of an unintentional and dangerous `reinterpret_cast`. Furthermore `static_cast<T>(...)` allows for easier grepping of casts.

  For a more thorough discussion, see ["ES.49: If you must use a cast, use a named cast"](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast) in the C++ Core Guidelines (Stroustrup & Sutter).

Tree-SHA512: bd6349b7ea157da93a47b8cf238932af5dff84731374ccfd69b9f732fabdad1f9b1cdfca67497040f14eaa85346391404f4c0495e22c467f26ca883cd2de4d3c
2020-06-10 18:32:43 -05:00
Wladimir J. van der Laan
3af9ef9194
Merge #12317: Document method for reviewers to verify chainTxData
7444149 Document method for reviewers to verify chainTxData (John Newbery)

Pull request description:

  This commit adds the final block hash of the window to getchaintxstats
  and documents how reviewers can verify changes to chainTxData.

Tree-SHA512: d16abb5f47d058e52660f4d495f1e453205b1b83716d7c810ff62a70338db721386c1808ec1fc8468f514e4d80cc58e3c96eeb3184cbbcb1d07830fa5e53f342
2020-06-10 18:32:43 -05:00
MarcoFalke
8ff171262a
Merge #12309: doc: Explain how to update chainTxData in release process
7f968ae107 doc: Explain how to update chainTxData in release process (Wladimir J. van der Laan)

Pull request description:

  Adds a short explanation how to update chainTxData to the release process. Mention where to get the data, and link to an example.

Tree-SHA512: 66b0eb12a25afb7b1da0788c8f9f9701d566cb7ce55899402440a57bef0e177b55e926442d3c8aa482299abe7c48ab94735d501c37f0a11fefb86e2fc2e33d9b
2020-06-10 18:32:43 -05:00
Wladimir J. van der Laan
52c96537a4
Merge #12298: Refactor HaveKeys to early return on false result
5bdbbdc Refactor HaveKeys to early return on false result (João Barbosa)

Pull request description:

  This consists in a trivial change where the return type of `HaveKeys()` is now `bool` meaning that it returns whether all keys are in the keystore, and early returns when one isn't.

Tree-SHA512: 03e35ea8486404b84884b49f6905c9f4fc161a3eeef080b06482d77985d5242a2bdd57a34b8d16abe19ee8c6cfa3e6fbcb935c73197d53f4cd468a2c7c0b889b
2020-06-10 18:32:43 -05:00
Wladimir J. van der Laan
2ec68225ad
Merge #12050: [trivial] Implements a virtual destructor on the BaseRequestHandler class.
bdb3231 Implements a virtual destructor on the BaseRequestHandler class. (251)

Pull request description:

  Granted that there is no undefined behavior in the current implementation, this PR implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that an object of a potential future derived BaseRequestHandler class with a destructor is destroyed through a pointer to this base class.

  This PR also fixes "_warning: delete called on 'BaseRequestHandler' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]_" warnings in environments where the project is built with the `-Wsystem-headers` flag; or environments where the `-Wdelete-non-virtual-dtor` diagnostics flag fires from system headers.

Tree-SHA512: 3c3b0797a8dbce8d8c5b244709e8bca41c4e28d5ba554a974bf7fc9128413e1098c457a00e51b21154ce6c11ce5da3071626e71d593b2550d0020bc589406eed
2020-06-10 18:32:43 -05:00
MarcoFalke
88df2de9d9
Merge #12330: Reduce scope of cs_main and cs_wallet locks in listtransactions
c409b1adac [rpc] Reduce scope of cs_main and cs_wallet locks in listtransactions (João Barbosa)

Pull request description:

  Trivial change, no behaviour change.

  Benchmark done as follow:
   - run with `-regtest`
   - wallet with 5000 transactions
   - measured the time spent with the lock and the total time
   - times are an average of 100 `listtransactions --count=...` calls

  | `--count` | lock (ms) | total (ms) | saving |
  |--:|--:|--:|--:|
  | 10 | 0.2230 | 0.2510 | 11% |
  | 100 | 2.5150 | 2.8690 | 12% |
  | 1000 | 20.0320 | 23.3490 | 14% |
  | 10000 | 105.2070 | 125.5310 | 16% |

Tree-SHA512: ebedfeeb4c8ad75c89128e53cae976a82967dbb5ffd129da0f7204ccf9c3c15070b3d509f3767bebd745512e410200cc546147c836e82409f95fc9b8d14fc3ed
2020-06-10 18:32:43 -05:00
MarcoFalke
0d4d3c3254
Merge #12283: Fix typos
1340eda3b7 Fix typos (practicalswift)

Pull request description:

  Fix typos.

Tree-SHA512: 533a136831387ef26e9a74ba078437496bee38cc026da73fa9e6f6e7f4d5665eccac24cf3ef05e6d3af1329a1214f5ce71b039ddb8378b074e6d4408b8701f95
2020-06-10 18:32:43 -05:00
Wladimir J. van der Laan
0211eecb14 Merge #14728: fix uninitialized read when stringifying an addrLocal
b7b36decaf878a8c1dcfdb4a27196c730043474b fix uninitialized read when stringifying an addrLocal (Kaz Wesley)
8ebbef016928811756e46b9086067d1c826797a8 add test demonstrating addrLocal UB (Kaz Wesley)

Pull request description:

  Reachable from either place where SetIP is used when all of:
  - our best-guess addrLocal for a peer is IPv4
  - the peer tells us it's reaching us at an IPv6 address
  - NET logging is enabled

  In that case, SetIP turns an IPv4 address into an IPv6 address without
  setting the scopeId, which is subsequently read in GetSockAddr during
  CNetAddr::ToStringIP and passed to getnameinfo. Fix by ensuring every
  constructor initializes the scopeId field with something.

Tree-SHA512: 8f0159750995e08b985335ccf60a273ebd09003990bcf2c3838b550ed8dc2659552ac7611650e6dd8e29d786fe52ed57674f5880f2e18dc594a7a863134739e3
2020-06-09 19:06:54 -05:00
UdjinM6
ab5aeed920
Optimize MN lists cache (#3506) 2020-06-09 07:43:34 +03:00
UdjinM6
91d9329093
Make CDeterministicMN::internalId private to make sure it's set/accessed properly (#3505)
* Make internalId private to make sure it's set/accessed properly

* evo: Make internalId only accessible by the constructor

* Tweak constructors

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-06-09 06:53:42 +03:00
UdjinM6
232430fac9
Fix ProcessNewBlock vs EnforceBestChainLock deadlocks in ActivateBestChain (#3492)
* Drop dead code in DoInvalidateBlock

* Let ActivateBestChain skip SyncWithValidationInterfaceQueue when called from IS or CL threads

* Use CL's own scheduler instead of a global one

* Revert "Let ActivateBestChain skip SyncWithValidationInterfaceQueue when called from IS or CL threads"

This reverts commit 1c9f6da50a.
2020-06-09 06:53:16 +03:00
Wladimir J. van der Laan
0f2b3f2226 Merge #14685: fix a deserialization overflow edge case
b08af10fb299dc3fdcd1f022619fb112c72e5d8e disallow oversized CBlockHeaderAndShortTxIDs (Kaz Wesley)
6bed4b374daf26233e96fa7863d4324a5bfa99c2 fix a deserialization overflow edge case (Kaz Wesley)
051faf7e9d4e32142f95f7adb31d2f53f656cb66 add a test demonstrating an overflow in a deserialization edge case (Kaz Wesley)

Pull request description:

  A specially-constructed BlockTransactionsRequest can cause `offset` to wrap in deserialization. In the current code, there is not any way this could be dangerous; but disallowing it reduces the potential for future surprises.

Tree-SHA512: 1aaf7636e0801a905ed8807d0d1762132ac8b4421a600c35fb6d5e5033c6bfb587d8668cd9f48c7a08a2ae793a677b7649661e3ae248ab4f8499ab7b6ede483c
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
f08419f5ea Merge #14532: Never bind INADDR_ANY by default, and warn when doing so explicitly
27c44ef9c61f64d941ab82ec232a68141a2fde90 rpcbind: Warn about exposing RPC to untrusted networks (Luke Dashjr)
d6a1287481428d982dc03be3a6d9aeef8398f468 CNetAddr: Add IsBindAny method to check for INADDR_ANY (Luke Dashjr)
3615003952ffbc814bdb53d9d0e45790f152bd2f net: Always default rpcbind to localhost, never "all interfaces" (Luke Dashjr)

Pull request description:

  A disturbingly large number of listening nodes appear to be also exposing their RPC server to the public internet. To attempt to mitigate this:

  * Only ever bind localhost by default, even if `rpcallowip` is specified. (A warning is given if `rpcallowip` is specified without `rpcbind`, since it doesn't really make sense to do.)
  * Warn about exposing the RPC server to untrusted networks if the user explicitly binds to any INADDR_ANY address.
  * Include a warning about untrusted networks in the `--help` documentation for `rpcbind`.

Tree-SHA512: 755bbca3db416a31393672eccf6675a5ee4d1eb1812cba73ebb4ff8c6b855ecc5df4c692566e9aa7b0f7d4dce6fedb9c0e9f3c265b9663aca36c4a6ba5efdbd4
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
90ddef59a6 Merge #14140: [Net] Switch nPrevNodeCount to vNodesSize
83d53058ae240a5c396ac927972ad96d2a11e903 Switch nPrevNodeCount to vNodesSize. (Patrick Strateman)

Pull request description:

  These both have the same value, but the variable naming is confusing.

Tree-SHA512: 4f645e89efdc69884ff4c8bbcf42e2b35d2733687c0fc6ab3f0797e0141fe23ef9cde8bb6ba422f47a88f554e55a099b1f0b3f47cb9fde12db3d46b9a0041bb0
2020-06-08 20:27:14 -05:00
MarcoFalke
490ef353c2 Merge #14027: Skip stale tip checking if outbound connections are off or if reindexing.
66b3fc5437 Skip stale tip checking if outbound connections are off or if reindexing. (Gregory Maxwell)

Pull request description:

  I got tired of the pointless stale tip notices in reindex and on nodes with connections disabled.

Tree-SHA512: eb07d9c5c787ae6dea02cdd1d67a48a36a30adc5ccc74d6f1c0c7364d404dc8848b35d2b8daf5283f7c8f36f1a3c463aacb190d70a22d1fe796a301bb1f03228
2020-06-08 20:27:14 -05:00
MarcoFalke
2fa446fde3 Merge #14025: p2p: Remove dead code for nVersion=10300
fa74d3d720 qa: Remove unused deserialization code in msg_version (MarcoFalke)
fa5099ceb7 p2p: Remove dead code for nVersion=10300 (MarcoFalke)

Pull request description:

  This code is undocumented and confusing as well as dead, since peers with a version that old are disconnected immediately.

Tree-SHA512: 58c131a2730b630ffdc191cd65fe736ed1bd57e184902e2af1b1399443c4654617e68774432016df023434055e85d2e8cd32fb03b40c508c3bb8db6d19427434
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
63b12699b3 Merge #13907: Introduce a maximum size for locators.
e254ff5d53b79bee29203b965fca572f218bff54 Introduce a maximum size for locators. (Gregory Maxwell)

Pull request description:

  The largest sensible size for a locator is log in the number of blocks.
   But, as noted by Coinr8d on BCT a maximum size message could encode a
   hundred thousand locators.  If height were used to limit the messages
   that could open new attacks where peers on long low diff forks would
   get disconnected and end up stuck.

  Ideally, nodes first first learn to limit the size of locators they
   send before limiting what would be processed, but common implementations
   back off with an exponent of 2 and have an implicit limit of 2^32
   blocks, so they already cannot produce locators over some size.

  Locators are cheap to process so allowing a few more is harmless,
   so this sets the maximum to 64-- which is enough for blockchains
   with 2^64 blocks before the get overhead starts increasing.

Tree-SHA512: da28df9c46c988980da861046c62e6e7f93d0eaab3083d32e408d1062f45c00316d5e1754127e808c1feb424fa8e00e5a91aea2cc3b80326b71c148696f7cdb3
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
396e9b634d Merge #13776: net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
2fb0066b9932f3725a5a0533530453c6da4010ce net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...) (practicalswift)

Pull request description:

  Add missing verification of IPv6 address in `CNetAddr::GetIn6Addr(...)`.

Tree-SHA512: 8b0681252eec9cf293a2043e99fdacec520e321b477d8aca1cbd6327b85bf6c5e8cd820fb914f097c62655947e88745ebccd824a78b995a8186e910e6fe520aa
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
02ed3cb8ca Merge #13672: Modified in_addr6 cast in CConman class to work with msvc
822a2a33a74c3f997e7982d629c8f6158b80c093 Modified in_addr6 cast in CConman class to work with msvc. (Aaron Clauson)

Pull request description:

  Fix to allow net.cpp to compile with MSVC. Without this fix the `(in6_addr)IN6ADDR_ANY_INIT` implicit cast generates a compilation error.

Tree-SHA512: f21c5002401dc93564dcf8d49fbafe7c03ad4182df1616d2ee201e2e172f1d696ca7982fb5b42a3b7d6878c8649823044a858401b4172239fb4b0cc2a38db282
2020-06-08 20:27:14 -05:00
Pasta
f0e5ef09fc scripted-diff: Replace NET_TOR with NET_ONION (#13575)
-BEGIN VERIFY SCRIPT-

sed --in-place'' --expression='s/NET_TOR/NET_ONION/g' $(git grep -I --files-with-matches 'NET_TOR')

-END VERIFY SCRIPT-

Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-08 20:27:14 -05:00
Jonas Schnelli
28a62b059a Merge #13537: GUI: Peer table: Visualize inbound/outbound state for every row
4132ad3bf Show symbol for inbound/outbound in peer table (wodry)

Pull request description:

  Fixes #13483

  The address in the network peer table is prefixed with an up-arrow symbolizing an outbound connection, or an down-array symbolizing an inbound connection. See screenshot.

  The user has an easy visual confirmation about the connection direction state. I really like it :)
  Impact to columns sorting is grouping by inbound/outbound first, which in my opinion is an advantage, too.
  ![bildschirmfoto](https://user-images.githubusercontent.com/8447873/41862752-13803eb2-78a5-11e8-9126-a52385f5ec19.png)

Tree-SHA512: d355f679d34c3006743c06750be5f36a083c1a8376da8f5f35045fcd9df964153409946fdde5007734f23bd692c91355962dc42df31122cdcf88e4affce8bc0e
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
0f7f679c14 Merge #13532: Log warning when deprecated network name 'tor' is used
9f8c54b1b5ddedddf47fc51c1fcb533321f6f89f Log warning message when deprecated network name 'tor' is used (e.g. option onlynet=tor) (wodry)

Pull request description:

  As @laanwj mentioned [here](https://github.com/bitcoin/bitcoin/pull/13418#discussion_r197645385), using option `onlynet=tor` is deprecated.

  I think it would be good to give the user a depcreaction warning feedback, so users can switch to `onlynet=onion` so there is a perspective for removing the deprecated `tor` in the future to decrease confusion.

  Currently, users maybe just wonder that they can use a undocumented option, or they are not aware that they use a deprecated option.

  Alternatively for the log warning message, I think at least this deprecetaion should be documented in the source code in a comment for readers of the source code.

Tree-SHA512: f4889793cdd62a0a13353e13994ed50ca7d367fa9da9897ce909f86cf0b0ce6151b3c484c8e514b8ac332949c6bbc71001e06e918248a1089f73756bd4840602
2020-06-08 20:27:14 -05:00
Pasta
409238bb2e add EXCLUSIVE_LOCKS_REQUIRED(cs_main) for Misbehaving and include validation.h
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-08 20:27:14 -05:00
Wladimir J. van der Laan
19ac12e516 Merge #13423: [net] Thread safety annotations in net_processing
1e3bcd251768baeb95e555d51d2dc787a6b2acee [net_processing] Add thread safety annotations (Jesse Cohen)
f393a533bebc088985f94c725b9af881500ba998 Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis (Jesse Cohen)

Pull request description:

  (note that this depends on #13417)
  This commit fully annotates all globals in net_processing with clang thread safety annotations. Subsequent commits will begin transitioning some of this data away from cs_main into locks that are local to net_processing. Static thread safety analysis should it easier to verify correctness of that process.

Tree-SHA512: b47aa410cb9ada21072370176aea9a74c575643fa1ee8cf1d43c8e28675eef17f33e5242ac422f840e8178e132ecb58412034c6334b68f1b57c686df80d4e8e2
2020-06-08 20:27:14 -05:00
Pasta
be08490c9d fix bip 61 in Dash Specific code, 13417 continued
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-08 20:27:14 -05:00
Pasta
ea3871ebd7 comment out extern declaration in DoS_tests.cpp
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-08 20:27:14 -05:00
Pasta
eb33bd1b33 move Misbehaving declaration into the header since we use it outside of net_processing.cpp
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-08 20:27:14 -05:00
Pasta
67c0459caf Adjust STALE_CHECK_INTERVAL to be correct for Dash
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-08 20:27:14 -05:00
Pieter Wuille
5b72c199ff Merge #13417: [net] Tighten scope in net_processing
3339ba28e9 Make g_enable_bip61 a member variable of PeerLogicValidation (Jesse Cohen)
6690a28606 Restrict as much as possible in net_processing to translation unit (Jesse Cohen)
1d4df02b7e [move-only] Move things only referenced in net_processing out of header file (Jesse Cohen)
02bbc05310 Rescope g_enable_bip61 to net_processing (Jesse Cohen)

Pull request description:

  As part of a larger effort to decouple net_processing and validation a bit, these are a bunch of simple scope cleanups. I've moved things out of the header file that are only referenced in net_processing and added static (or anonymous namespace) modifiers to everything possible in net_processing.

  There are a handful of functions which could be static except that they are exposed for the sake of unit testing - these are explicitly commented. There has been some discussion of a compile time annotation, but no conclusion has been reached on that yet.

  This is somewhat related to other prs #12934 #13413 #13407 and will be followed by prs that reduce reliance on cs_main to synchronize data structures which are translation unit local to net_processing

Tree-SHA512: 46c9660ee4e06653feb42ba92189565b0aea17aac2375c20747c0d091054c63829cbf66d2daddf65682b58ce1d6922e23aefea051a7f2c8abbb6db253a609082
Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/init.cpp
#	src/net_processing.cpp
#	src/net_processing.h
#	src/test/test_dash.cpp
2020-06-08 20:27:14 -05:00
PastaPastaPasta
fe98b81b80
implemented labeler which automatically adds RPC label to anything modifying RPC files (#3499)
* implemented labeler which automatically adds RPC label to anything modifying RPC files

Signed-off-by: Pasta <pasta@dashboost.org>

* add src/wallet/rpc*

Signed-off-by: pasta <pasta@dashboost.org>
2020-06-08 06:10:52 +03:00
UdjinM6
ae5faf23da
Better error handling while processing special txes (#3504)
* Return invalid state for GetTxPayload failures instead of asserting

* Throw an error when internal `find` fails instead of asserting

* Unify mnlist checks for lists created from blocks and lists created via updates of older lists with diffs

* Wrap evo block processing in try..catch to make sure all earlier introduced throws are caught

* evo/llmq: Adjust reject reasons for CFinalCommitmentTxPayload

In CheckLLMQCommitment this reject string was used so i adjusted the
other one in CQuorumBlockProcessor::GetCommitmentsFromBlock and the new
introduced in PR #3506

* return state.DoS instead of asserting in cbtx.cpp

Signed-off-by: pasta <pasta@dashboost.org>

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
Co-authored-by: pasta <pasta@dashboost.org>
2020-06-08 05:57:57 +03:00
dustinface
13a45ec323
rpc: Validate provided keys for query_options parameter in listunspent (#3507)
With this change listunspent will throw an error if there is a wrong key
in the query_option object.
2020-06-04 14:43:51 +03:00
dustinface
9b47883884
contrib: Added dustinface.pgp (#3502) 2020-06-04 14:43:33 +03:00
dustinface
048503bcb5
qt: Some UI fixes and improvements (#3500)
* qt: Updated loadStylesheet and added general.css for shared styles

* qt: Customized QRadioButton and QCheckBox

- Introduced new images for QCheckBox and QRadioButton
- Make use of Hover/Pressed/Disabled/Indeterminate states 
- Use customized Checkboxes and Radio-Buttons in CoinControlWidget

* qt: Removed qtreeview_selected image

This looks weird in the dark theme. Will introduce new arrows here.

* qt: Redesigned arrows and their usage

- Added new arrow images
- Make use of Hover/Pressed/Disabled states for QAbstractSpinBox and 
QComboBox
- Use custom arrows in QHeaderView
- Use custom arrows in QTreeWidget branch selectors

* qt: Slightly increased checkboxes and radio buttons

* qt: Move the scrollbars css loading into loadStyleSheet

This way all windows will have the same scrollbars and not only the main 
window.

* qt: Use padding instead of margin for QTreeWidget::branch styles

Use of margin here lead to a 2px vertical line at the left edge cause of 
the background below.

* qt: Use border-image for the scrollbar arrows and adjust the size.

background-image lead to not showing the arrows here because it 
obviously was scaled incorrect with the higher resolution of the image 
files.

* qt: Add missing grey arrows and make use of disabled states of scrollbar arrows

* qt: Adjust dashThemeActive and also use it in BitcoinGUI::createToolBars

* qt: Fixed copyright year in general.css
2020-06-04 14:43:06 +03:00
PastaPastaPasta
0662f170f0
Merge #12836: Make WalletInitInterface and DummyWalletInit private, fix nullptr deref (#3498)
d894894 wallet: Refactor to WalletInitInterface* const g_wallet_init_interface (João Barbosa)
39bc2fa wallet: Make WalletInitInterface and DummyWalletInit private (João Barbosa)

Pull request description:

  Implementations of `WalletInitInterface` don't have to be public, so make them private. This makes the interface instantiation static. Also reduces `ENABLE_WALLET` usage and removes the unnecessary `src/wallet/init.h` header.

Tree-SHA512: 203c49d8c85252d1bd0ff1d7ed8bcdc842d12d2d396e965cc70be5c8159a62e98ec23d32d2f3dc48a53e575844130d0a7dedac3cc2fe4621d31319b7a1c9ba89
Signed-off-by: pasta <pasta@dashboost.org>

# Conflicts:
#	src/qt/dash.cpp
#	src/wallet/init.cpp
#	src/wallet/init.h
#	src/walletinitinterface.h

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
2020-05-20 12:24:51 +03:00
PastaPastaPasta
8fcda67a54
Remove spork 15, 16, 20 (#3493)
Signed-off-by: pasta <pasta@dashboost.org>
2020-05-20 12:24:35 +03:00
UdjinM6
9d3546baee
Reintroduce mixing hard cap for all but the largest denom (#3489)
* Split -privatesenddenoms option into two to be able to specify initial/batched denom "checkpoint" and the hard cap

* Introduce MAX_PRIVATESEND_DENOM_OUTPUTS = 500 constant

Also make sure to never exceed it while looping

* Make sure to never exceed nPrivateSendDenomsBatched while creating batches

* Tweak debug logging

* Use auto for nDenomValue

* Fix detection of so called "final" denom

Now that we don't skip denoms anymore conditions are slightly different. Without this fix the "final" denom is created in a separate tx even when there is enough room in the current one.

* batched -> goal

* Tweak json and a warning

* Drop excessive checks for MAX_PRIVATESEND_DENOM_OUTPUTS in the "goal" part of the algo

Rename it to PRIVATESEND_DENOM_OUTPUTS_THRESHOLD to beter match the meaning and tweak comments

* fix log
2020-05-20 12:23:48 +03:00
UdjinM6
397630a82c
CI: Fix Gitlab nowallet and release builds (#3491) 2020-05-18 15:26:53 +03:00
PastaPastaPasta
a9fc40fb0a
add "Verifying a Rebase" section to CONTRIBUTING.md (#3487)
Signed-off-by: Pasta <pasta@dashboost.org>
2020-05-18 15:26:42 +03:00
dustinface
0c5c99243a
rpc/wallet: Add coinType to queryOptions of listunspent (#3483)
* wallet: Add MAX_COIN_TYPE to CoinTypes to allow dynamic range checks

* rpc: Add coinType to the queryOptions object of listunspent rpc command

This allows to filter the output by CoinType:

0 -> ALL_COINS 
1 -> ONLY_FULLY_MIXED
2 -> ONLY_READY_TO_MIX
3 -> ONLY_NONDENOMINATED
4 -> ONLY_1000
5 -> ONLY_PRIVATESEND_COLLATERAL

* wallet/rpc: Rename CoinType ONLY_1000 to ONLY_MASTERNODE_COLLATERAL

Make it more obvious what ONLY_1000 is in the description of the 
listunspent command.

* wallet/rpc: Formatting only

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>

* wallet: Add MIN_COIN_TYPE to CoinTypes

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>

* rpc: Check the lower boundary of CoinType in listunspent's queryOptions

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-05-18 15:26:18 +03:00
UdjinM6
3a56ed9ca6
Fix NO_WALLET=1 build (#3490) 2020-05-18 02:41:00 +03:00
Wladimir J. van der Laan
4a7c3c22a7
Merge #13543: depends: Add RISC-V support
974f0bf8e684696be7796dbf3d48ff0a41f4ac26 depends: Mention RISC-V known compilation issue with gcc-7.3.x (Wladimir J. van der Laan)
0d1f38c45ff40f17b42074e3b58211e794a19edb depends: update zmq config.guess/config.sub for riscv support (fanquake)
409481c46555afb34a038dbc69a8285b83eb952e depends: latest config.sub (fanquake)
d7005e9988ddae4d3507963b42c525257c34ddb0 depends: latest config.guess (fanquake)
359e2e352590e1e473da70e28a38d14a068a3103 depends: Add RISC-V support (Wladimir J. van der Laan)

Pull request description:

  This adds support for riscv32 and riscv64 builds to the depends system.

  The change consists of documentation and build system changes. The most significant change is an update of `config.sub` and `config.guess` inside zeromq patch, as the current version does not recognize the `riscv*` host tuples (there's no new version of ZeroMQ yet with newer ones).

  Good thing: RISC-V 64-bit toolchain packages can be installed out of the box on Ubuntu 18.04+.

  I would also like to add RISC-V 64-bit executables to gitian, but this will not be possible until #12511 .

Tree-SHA512: 358ed72ee9e4ae44e7d305c09a4ff5ce5460eeb7ed915eb25d39c8f43b61e7b347f51bf0ae5d83ddb4ce8876dea7703c926b3baa3cccb4932b3bc17160d801bb
(cherry picked from commit 6c6a3001e51b1679af2f375f158d8c87bbb330bc)

# Conflicts:
#	depends/Makefile
2020-05-17 02:31:35 -03:00
Wladimir J. van der Laan
0c2b520c48
Merge #12402: [depends] expat 2.2.5, ccache 3.4.1, miniupnpc 2.0.20180203
25409b1 fixme: depends: Add D_DARWIN_C_SOURCE to miniupnpc CFLAGS (fanquake)
3335d45 [depends] latest config.guess and config.sub (fanquake)
41550d6 [depends] miniupnpc 2.0.20180203 (fanquake)
61647a4 [depends] ccache 3.4.1 (fanquake)
5a10859 [depends] expat 2.2.5 (fanquake)

Pull request description:

  miniupnpc changelog: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.0.20180203.tar.gz
  2.0.20180203 includes fixes for the recent buffer overflow and segfault issues, see https://github.com/miniupnp/miniupnp/issues/268.

  expat changelog: https://github.com/libexpat/libexpat/blob/R_2_2_5/expat/Changes
  2.2.2 & 2.2.3 included security fixes.

  ccache changelog: https://ccache.samba.org/releasenotes.html#_ccache_3_4_1

  Also includes latest config.guess and config.sub.

Tree-SHA512: 5115b6ccf2bc50c62fd16ab2350bdc752eef7db8b1e4fbe35998fe1aac3702baa6c7f5e471ec48f7c614278df20a68ee6a254dde7c3e2d5c6ce2d10257a5aa21
(cherry picked from commit 59e032b43c)

# Conflicts:
#	depends/packages/miniupnpc.mk
#	depends/packages/native_ccache.mk
#	doc/dependencies.md
2020-05-17 02:31:35 -03:00
Wladimir J. van der Laan
45db031556
Merge #11986: [depends] zeromq 4.2.3
13a399a46 depends: patch pthread_set_name_np out of zeromq (Cory Fields)
8f7922636 depends: zeromq 4.2.3 (fanquake)

Pull request description:

  This is a followup to #9254 and #11981. Zeromq 4.2.3 was released just after #9254 was merged, and contains a years worth of improvements/bug fixes. See the release notes [here](https://github.com/zeromq/libzmq/releases/tag/v4.2.3).

  Todo:
  - [ ] Add zeromq-4.2.3.tar.gz to /depends-sources on bitcoincore.org
  - [ ] Verify gitian builds are still OK
  - [ ] Check: https://github.com/zeromq/libzmq/pull/2787

Tree-SHA512: 85e06f47be3e1fdedcee50ce90e3391d69df2ea1c167472ffc3126d8970d418eb75141b970e422eb2fda9a8cad00e6ba5b36afa53565171a9ebaa152a9dc9b60
(cherry picked from commit 765a3ebb02)

# Conflicts:
#	doc/dependencies.md
2020-05-17 02:31:19 -03:00
PastaPastaPasta
0b3c3e8406
Merge bitcoin#11415: [RPC] Disallow using addresses in createmultisig (#3482)
* Merge #11415: [RPC] Disallow using addresses in createmultisig

1df206f Disallow using addresses in createmultisig (Andrew Chow)

Pull request description:

  This PR should be the last part of #7965.

  This PR makes createmultisig only accept public keys and marks the old functionality of accepting addresses as deprecated.

  It also splits `_createmultisig_redeemscript` into two functions, `_createmultisig_getpubkeys` and `_createmultisig_getaddr_pubkeys`. `_createmultisig_getpubkeys` retrieves public keys from the RPC parameters and `_createmultisig_getaddr_pubkeys` retrieves addresses' public keys from the wallet. `_createmultisig_getaddr_pubkeys` requires the wallet and is only used by `addwitnessaddress` (except when `createmultisig` is used in deprecated mode).

  `addwitnessaddress`'s API is also changed. Instead of returning just an address, it now returns the same thing as `createmultisig`: a JSON object with two fields, address and redeemscript.

Tree-SHA512: a5796e41935ad5e47d8165ff996a8b20d5112b5fc1a06a6d3c7f5513c13e7628a4fd37ec30fde05d8b15abfed51bc250710140f6834b13f64d0a0e47a3817969

* fix backport

Signed-off-by: pasta <pasta@dashboost.org>

* fix backport

Signed-off-by: pasta <pasta@dashboost.org>

* fix backport

Signed-off-by: pasta <pasta@dashboost.org>

* Dashify

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2020-05-15 12:34:41 +03:00
PastaPastaPasta
926087aac6
Implement significantly improved createdenominations algorithm (#3479)
* Allow the creation of denoms on regtest.
Ignore the fact there are no MNs on regtest

Signed-off-by: pasta <pasta@dashboost.org>

* implement significantly improved createdenominations algorithm

Signed-off-by: pasta <pasta@dashboost.org>

* change int denomsToCreate

Signed-off-by: pasta <pasta@dashboost.org>

* Remove debugging code and use a const iterator instead of calling find multiple times

Signed-off-by: pasta <pasta@dashboost.org>

* vecDenominationsSkipped and *DenomSkipped are nolonger used

Signed-off-by: Pasta <pasta@dashboost.org>
Signed-off-by: pasta <pasta@dashboost.org>

* inputs -> outputs

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-05-15 12:34:12 +03:00
10xcryptodev
fe208c98e3
Feat. request for Dash Platform: quorum sign rpc command with additional quorumHash #3424 (#3446)
* add quorumHash to rpc command quorum sign

* change quorumHash to optional for compatibility

* improving code format

* Update src/rpc/rpcquorums.cpp code formating

Co-Authored-By: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

* Update src/rpc/rpcquorums.cpp code format

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update src/rpc/rpcquorums.cpp parameter check

Co-Authored-By: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-05-15 12:33:40 +03:00
10xcryptodev
4c1f65baae
Fix #3241 UX/UI - Introduce PrivateSend tab which allows to spend fully mixed coins only (#3442)
* #3241 change PrivateSend and balance location

* include resource location back

* change back balance and privatesend checkbox position

* add new PrivateSend tab on main window and PrivateSend tray option

* adjust code formating

* revert QT TODO

* Update src/qt/forms/sendcoinsdialog.ui code formating

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>

* code formating update

* clear send dialog and remove unnecessary warning

* change clear location for better UX and performance

* remove variable used in warning

* Do not clear everything, simply unselect non-fully-mixes coins instead

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Warn about unselected coins

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Disable PrivateSend tab/menu item when PrivateSend is disabled

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* fix tab selection bold font

* fix use available balance for PS

* change back line

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-05-15 12:33:07 +03:00