Commit Graph

17845 Commits

Author SHA1 Message Date
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
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
PastaPastaPasta
f46617dbab
add litemode information to help texts regarding CL/IS and change getbestchainlock to throw an error if running in litemode (#3478)
Signed-off-by: Pasta <pasta@dashboost.org>
2020-05-14 23:10:58 +03:00
UdjinM6
5cabc8f5ca
Introduce ONLY_PRIVATESEND coin type to select fully mixed coins only (#3459)
* Introduce ONLY_PRIVATESEND coin type to select fully mixed coins only

Note: ONLY_DENOMINATED will NOT return fully mixed coins now

* Remove useless check

* Rename coin types to better match the meaning

ONLY_DENOMINATED -> ONLY_READY_TO_MIX
ONLY_PRIVATESEND -> ONLY_FULLY_MIXED

* Drop another two unnecessary checks
2020-05-14 23:10:18 +03:00
dustinface
e0ff9af2b0
qt: Allow and process URIs pasted to the payTo field of SendCoinsEntry (#3475)
* qt: Allow and process URIs pasted to the payTo field of SendCoinsEntry

* qt: Prevent double invocation of the textChanged slot when pasting an URI

* qt: Keep the addressbook's label if there is already one for the address

If there is no label for the given address in the addressbook but the 
URI contains a label it will use the URI's label to update the 
addressbook.

* qt: Always prefer the addressbook's label over an URI's label
2020-05-12 02:33:21 +03:00
PastaPastaPasta
505542663d
Merge #12384: [Docs] Add version footnote to tor.md (#3473)
* Merge #12384: [Docs] Add version footnote to tor.md

39d2911 [Docs] Add version footnote to tor.md (Damian Williamson)

Pull request description:

  [Docs] Add version footnote to tor.md

  Added note to section 2, part -edits to `/etc/tor/torrc`- indicating this is only required for Tor version 0.2.7.0 and older, since section 3 states it is valid for Tor version 0.2.7.1 and newer. Added ref link from section 2 version footnote to section 3. Re-styled headings to work on GitHub -alternate heading style markup creation issue with numbered headings and thus headings and automatic heading links are broken-

  Ref: [Issue# 12376](https://github.com/bitcoin/bitcoin/issues/12376)

  Signed-off-by: Damian Williamson \<willtech@live.com.au\>

Tree-SHA512: 439f4ccc3e196011af448b220adf26b0e653ac589bf4cfbbc276c1500c9d08f209c9d6101e4d232857779d9f25164cfb222ed30e3d63de116f9121e6ebde31c3
Signed-off-by: pasta <pasta@dashboost.org>
Signed-off-by: Pasta <pasta@dashboost.org>

* bitcoin -> Dash Core

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

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
2020-05-12 02:32:38 +03:00
konez2k
1c20160933
Fix gobject submit: replace request params with txidFee (#3471)
Replaced request.params[5] with txidFee, cause the param could be null at that index when the submit type is a masternode trigger,  triggering a JSON parsing error (expected str, got null).
2020-05-11 15:37:14 +03:00
thephez
970c23d6e6
Remove logic for forcing chainlocks without DIP8 activation on testnet (#3470) 2020-05-11 15:35:55 +03:00
dustinface
ae15299117
Feature request #3425 - Add information to "protx diff" (#3468)
* llmq: Add more information to the result of CFinalCommitment::ToJson

Example output: 

```
{
      "version": 1,
      "llmqType": 1,
      "quorumHash": 
"000002a20a35757fc467f0ebe8663f76e4c5df74411cc5f1735cfd92278071fe",
      "signersCount": 49,
      "signers": "03fbffffffffff",
      "validMembersCount": 49,
      "validMembers": "03fbffffffffff",
      "quorumPublicKey": 
"8db1108b50dd741076b577f6798f0bf382ca4d11dafd55ed14aaaf613f604aa55bf1da1f0469f75105376e440381ee23",
      "quorumVvecHash": 
"feedb15d5a7ca25a68d9c51036973d37925d8439d4769d7dd7bace7440089071",
      "quorumSig": 
"1879f6260ef427dc9542088b39e02a8e73e34c0484269cbc12108ab991d438f81e5be80a5b4b5595b6634113fdf060060c8fe190677627fb2d25f6e052c7f93598d36dd415f8f84c693c6a5943098616a1e135522852d8f572bb6e1470df4a94",
      "membersSig": 
"8ef7d881fcc1e8111dd82c556ab62dad56ea5ecb47a9ac067eb2057d92d27e39530630a7f77d19adc857d33eb485a1b601b2d78ac4c73742f2036089bfb1f25441f1dfcd3cfd1eed6e7d664c0e97bf75b7d7097ebd647791fbcef070fe3e3e91"
    }
```

* llmq: Changed the byte order in ToHexStr(const std::vector<bool>& vBits)
2020-05-11 15:35:28 +03:00
10xcryptodev
017c4779ca
Fix recovery from coin db crashes (and dbcrash.py test) (#3467)
* 🪲 improve evodb consistency recovering from dbcrash

* Adjust the fix

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

* Fix it

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

* Disable recovery from a crash during a fork and a corresponding part of dbcrash.py

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

* Skip some checks in CQuorumBlockProcessor when replaying blocks after the crash

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

* Process special txes in RollforwardBlock

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

* Update src/init.cpp

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-05-11 15:33:21 +03:00
UdjinM6
d5f403d3fd
Refactor and fix GetRealOutpointPrivateSendRounds (#3460)
* Refactor and fix GetRealOutpointPrivateSendRounds

Changes:
- streamline logic
- use much more compact/direct map to store outpoint rounds
- per-wallet map instead of a static one
- hold cs_wallet

* Bail out early if one of outputs in the same tx is a non-denom one
2020-05-11 15:31:20 +03:00
UdjinM6
c06838e205
Streamline processing of pool state updates (#3458)
Changes in behaviour:
- unlock coins, return keys to keypool and set state POOL_STATE_ERROR on error, reset session on timeout later
- drop POOL_STATE_SUCCESS (wasn't really used)
2020-05-11 15:30:57 +03:00
UdjinM6
af2c411924
Merge pull request #3462 from PastaPastaPasta/backport-10740
Backport loadwallet
2020-05-11 15:29:08 +03:00
UdjinM6
ed7d8c883c
Fix autobackup 2020-05-10 12:13:46 -05:00
PastaPastaPasta
cd42171a4f
bitcoind -> dashd
Co-Authored-By: dustinface <35775977+xdustinface@users.noreply.github.com>
2020-05-10 12:13:46 -05:00
xdustinface
b1c26d4aae
qt: Disconnect CClientUIInterface from SplashScreen::ConnectWallet
Due to not disconnecting the signal there the trace of the `loadwallet` 
rpc command ends 
in a call of `SplashScreen::ConnectWallet` for the not longer existent 
splashscreen object.

7770a7da95/src/wallet/wallet.cpp (L4192)

Wasn't an issue before the `loadwallet` rpc was introduced because 
`CWallet::LoadWallet` was only called once on startup.
2020-05-10 12:13:46 -05:00
Russell Yanofsky
b0c1406bee
End Merge #11851: Add m_ prefix to WalletBatch::m_batch 2020-05-10 12:13:46 -05:00
Russell Yanofsky
1cf961182f
Update walletdb comment after renaming.
Text from https://github.com/bitcoin/bitcoin/pull/11851#issuecomment-350320608
by John Newbery <john@johnnewbery.com>.
2020-05-10 12:13:46 -05:00
Pasta
b1c8875579
scripted-diff: Rename wallet database classes (begin bitcoin#11851)
-BEGIN VERIFY SCRIPT-

sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp
sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h
ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; }
ren CDBEnv           BerkeleyEnvironment
ren CDB              BerkeleyBatch
ren CWalletDBWrapper WalletDatabase
ren CWalletDB        WalletBatch
ren dbw              database
ren m_dbw            m_database
ren walletdb         batch
ren pwalletdb        batch
ren pwalletdbIn      batch_in
ren wallet/batch.h   wallet/walletdb.h
ren pwalletdbEncryption encrypted_batch

-END VERIFY SCRIPT-

Signed-off-by: Pasta <pasta@dashboost.org>
2020-05-10 12:13:46 -05:00
John Newbery
8ebbdfe805
Merge #10740: [wallet] loadwallet RPC - load wallet at runtime
cd53981 [docs] Add release notes for `loadwallet` RPC. (John Newbery)
a46aeb6 [wallet] [tests] Test loadwallet (John Newbery)
5d15260 [wallet] [rpc] Add loadwallet RPC (John Newbery)
876eb64 [wallet] Pass error message back from CWallet::Verify() (John Newbery)
e0e90db [wallet] Add CWallet::Verify function (John Newbery)
470316c [wallet] setup wallet background flushing in WalletInit directly (John Newbery)
59b87a2 [wallet] Fix potential memory leak in CreateWalletFromFile (John Newbery)

Pull request description:

  Adds a `loadwallet` RPCs. This allows wallets to be loaded dynamically during runtime without having to stop-start the node with new `-wallet` params.

  Includes functional tests and release notes.

  Limitations:

  - currently this functionality is only available through the RPC interface.
  - wallets loaded in this way will not be displayed in the GUI.

Tree-SHA512: f80dfe32b77f5c97ea3732ac538de7d6ed7e7cd0413c2ec91096bb652ad9bccf05d847ddbe81e7cd3cd44eb8030a51a5f00083871228b1b9b0b8398994f6f9f1
2020-05-10 12:13:46 -05:00
Wladimir J. van der Laan
3d73de3381
Merge #13028: Make vpwallets usage thread safe
e2f58f4 wallet: Make vpwallets usage thread safe (João Barbosa)

Pull request description:

  This PR turns the functions introduced in #13017 thread safe. This is required to correctly support dynamically loading wallets, which is implemented in #10740.

Tree-SHA512: efaa09e501636cf957aa33de83719ce09dc0c2a19daff741a94ef10d6b7ba5dee538355b80c96ead995140f99f5df0c92fb0e22ae1adb8f397eb478280c8d8c7
2020-05-10 11:15:58 -05:00
Wladimir J. van der Laan
b0dc2ab3c1
Merge #11862: Network specific conf sections
c25321f Add config changes to release notes (Anthony Towns)
5e3cbe0 [tests] Unit tests for -testnet/-regtest in [test]/[regtest] sections (Anthony Towns)
005ad26 ArgsManager: special handling for -regtest and -testnet (Anthony Towns)
608415d [tests] Unit tests for network-specific config entries (Anthony Towns)
68797e2 ArgsManager: Warn when ignoring network-specific config setting (Anthony Towns)
d1fc4d9 ArgsManager: limit some options to only apply on mainnet when in default section (Anthony Towns)
8a9817d [tests] Use regtest section in functional tests configs (Anthony Towns)
30f9407 [tests] Unit tests for config file sections (Anthony Towns)
95eb66d ArgsManager: support config file sections (Anthony Towns)
4d34fcc ArgsManager: drop m_negated_args (Anthony Towns)
3673ca3 ArgsManager: keep command line and config file arguments separate (Anthony Towns)

Pull request description:

  The weekly meeting on [2017-12-07](http://www.erisian.com.au/meetbot/bitcoin-core-dev/2017/bitcoin-core-dev.2017-12-07-19.00.log.html) discussed allowing options to bitcoin to have some sensitivity to what network is in use. @theuni suggested having sections in the config file:

      <cfields> an alternative to that would be sections in a config file. and on the
                cmdline they'd look like namespaces. so, [testnet] port=5. or -testnet::port=5.

  This approach is (more or less) supported by `boost::program_options::detail::config_file_iterator` -- when it sees a `[testnet]` section with `port=5`, it will treat that the same as "testnet.port=5". So `[testnet] port=5` (or `testnet.port=5` without the section header) in bitcoin.conf and `-testnet.port=5` on the command line.

  The other aspect to this question is possibly limiting some options so that there is no possibility of accidental cross-contamination across networks. For example, if you're using a particular wallet.dat on mainnet, you may not want to accidentally use the same wallet on testnet and risk reusing keys.

  I've set this up so that the `-addnode` and `-wallet` options are `NETWORK_ONLY`, so that if you have a bitcoin.conf:

      wallet=/secret/wallet.dat
      upnp=1

  and you run `bitcoind -testnet` or `bitcoind -regtest`, then the `wallet=` setting will be ignored, and should behave as if your bitcoin.conf had specified:

      upnp=1

      [main]
      wallet=/secret/wallet.dat

  For any `NETWORK_ONLY` options, if you're using `-testnet` or `-regtest`, you'll have to add the prefix to any command line options. This was necessary for `multiwallet.py` for instance.

  I've left the "default" options as taking precedence over network specific ones, which might be backwards. So if you have:

      maxmempool=200
      [regtest]
      maxmempool=100

  your maxmempool will still be 200 on regtest. The advantage of doing it this way is that if you have `[regtest] maxmempool=100` in bitcoin.conf, and then say `bitcoind -regtest -maxmempool=200`, the same result is probably in line with what you expect...

  The other thing to note is that I'm using the chain names from `chainparamsbase.cpp` / `ChainNameFromCommandLine`, so the sections are `[main]`, `[test]` and `[regtest]`; not `[mainnet]` or `[testnet]` as might be expected.

  Thoughts? Ping @MeshCollider @laanwj @jonasschnelli @morcos

Tree-SHA512: f00b5eb75f006189987e5c15e154a42b66ee251777768c1e185d764279070fcb7c41947d8794092b912a03d985843c82e5189871416995436a6260520fb7a4db
2020-05-10 11:15:58 -05:00
Jonas Schnelli
aaf5bf1a7e Merge #12878: [refactor] Config handling refactoring in preparation for network-specific sections
77a733a99 [tests] Add additional unit tests for -nofoo edge cases (Anthony Towns)
af173c2be [tests] Check GetChainName works with config entries (Anthony Towns)
fa27f1c23 [tests] Add unit tests for ReadConfigStream (Anthony Towns)
087c5d204 ReadConfigStream: assume the stream is good (Anthony Towns)
6d5815aad Separate out ReadConfigStream from ReadConfigFile (Anthony Towns)
834d30341 [tests] Add unit tests for GetChainName (Anthony Towns)
11b6b5b86 Move ChainNameFromCommandLine into ArgsManager and rename to GetChainName (Anthony Towns)

Pull request description:

  This does a bit of refactoring of the configuration handling code in order to add additional tests to make adding support for [test]/[regtest] sections in the config file in #11862 easier. Should not cause any behaviour changes.

Tree-SHA512: 8d2ce1449fc180de03414e7e569d1a21ba1e9f6564e13d3faf3961f710adc725fa0d4ab49b89ebd2baa11ea36ac5018377f693a84037d386a8b8697c9d6db3e9
2020-05-09 17:35:59 -05:00
MarcoFalke
7a89b916d1 Merge #12713: Track negated options in the option parser
f7683cba7b Track negated arguments in the argument paser. (Evan Klitzke)
4f872b2450 Add additional tests for GetBoolArg() (Evan Klitzke)

Pull request description:

  This change explicitly enable tracking negated options in the option parser. A negated option is one passed with a `-no` prefix. For example, `-nofoo` is the negated form of `-foo`. Negated options were originally added in the 0.6 release.

  The change here allows code to explicitly distinguish between cases like `-nofoo` and `-foo=0`, which was not possible previously. The option parser does not have any changed semantics as a result of this change, and existing code will parse options just as it did before.

  The motivation for this change is to provide a way to disable options that are otherwise not boolean options. For example, the `-debuglogfile` option is normally interpreted as a string, where the value is the log file name. With this change a user can pass in `-nodebuglogfile` and the code can see that it was explicitly negated, and use that to disable the log file.

  This change originally split out from #12689.

Tree-SHA512: cd5a7354eb03d2d402863c7b69e512cad382781d9b8f18c1ab104fc46d45a712530818d665203082da39572c8a42313c5be09306dc2a7227cdedb20ef7314823
2020-05-09 17:35:59 -05:00
Wladimir J. van der Laan
8700f460e3 Merge #12305: [docs] [refactor] Add help messages for datadir path mangling
5460460 Add AbsPathForConfigVal to consolidate datadir prefixing for path args (James O'Beirne)
a1e1305 Clarify help messages for path args to mention datadir prefix (James O'Beirne)

Pull request description:

  Change `-conf`'s help message to indicate that relative path values will be prefixed by the datadir path. This behavior probably merits clarification; it's kind of confusing when attempting to specify a configuration file in the current directory with `-conf=bitcoin.conf`, but instead loading the `bitcoin.conf` file in ~/.bitcoin datadir.

  ### Edit

  This PR has been modified to document all cases where relative path configurations are modified to be under datadir. A small refactoring has also been added which consolidates this normalization.

Tree-SHA512: be4fc0595fbeba33d17af08f59898af45e76a44f00719ea0282403b155ac6755584604fab765250a3aa14ed6991882c4d1ccbe601184362c5ba97c886bdda344
2020-05-09 17:35:59 -05:00