Commit Graph

18750 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
f8a2413b49
Merge #12714: Introduce interface for signing providers
d40f06a Introduce interface for signing providers (Pieter Wuille)

Pull request description:

  `CKeyStore` is a rich interface that provides many features, including knowledge of scripts and pubkeys for solving, private keys for signing, in addition to watch-only keys and scripts, and distinguishing lack of keys from them just being encrypted.

  The signing logic in script/sign does not actually need most of these features. Here we introduce a simpler interface (`SigningProvider`) which *only* provides keys and scripts. This is actually sufficient for signing.

  In addtion, we swap the dependency between keystore and script/sign (keystore now depends on script/script with `CKeyStore` deriving from `SigningProvider`, rather than `CKeyStore` being the interface that signing relies on).

  This is a very early step towards the design in https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2, separating the concern between deciding what outputs are ours and signing.

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

# Conflicts:
#	src/script/sign.cpp
#	src/script/sign.h
2020-10-14 13:27:32 -04:00
Wladimir J. van der Laan
9909c3aca7
Merge #12717: [REST] Handle UTXO retrieval when ignoring the mempool
9cb9af8 [REST] Handle UTXO retrieval when ignoring the mempool (Roman Zeyde)
1fdc7c4 Make CTxMemPool::isSpent() const (Roman Zeyde)

Pull request description:

  Current REST API always returns empty UTXO when invoked without `/checkmempool/` URL part.

  After the fix:
  ```
  $ curl -s http://localhost:8332/rest/getutxos/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098-0.json | jq
  {
    "chainHeight": 514109,
    "chaintipHash": "0000000000000000001fe76d1445e8a6432fd2de04261dc9c5915311dc7ad6de",
    "bitmap": "1",
    "utxos": [
      {
        "height": 1,
        "value": 50,
        "scriptPubKey": {
          "asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
          "hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
          "reqSigs": 1,
          "type": "pubkey",
          "addresses": [
            "12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
          ]
        }
      }
    ]
  }
  ```

  Before the fix:
  ```
  $ curl -s http://localhost:8332/rest/getutxos/0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098-0.json | jq
  {
    "chainHeight": 514109,
    "chaintipHash": "0000000000000000001fe76d1445e8a6432fd2de04261dc9c5915311dc7ad6de",
    "bitmap": "0",
    "utxos": []
  }
  ```

Tree-SHA512: 994a350cb34a3c8f5a7afbc169c6b177c5be6cf223b2071c62d63644819d416d3e10d1c58b244d9d351bae7233d2974aa5e9ebadd1b5d6218f5245558675be0d
2020-10-14 13:27:31 -04:00
MarcoFalke
af08c75579
Merge #13775: doc: Remove newlines from error message
620361fce8 Fix accidental use of the addition assignment operator ("+="). Remove newlines from error message. (practicalswift)

Pull request description:

  Fix accidental use of the addition assignment operator (`+=`).

  _Note to reviewers:_ Perhaps the `\n`:s should be removed too?

Tree-SHA512: 4e8c2dfd6025d78ef9d60522297994829dacc447e6b6782e15c0bdd5dd2daa17ca9a8948bfa9a15be57d9286092356381d7e6747980303852d273eb0df0dd76b
2020-10-14 13:27:31 -04:00
Wladimir J. van der Laan
ba32ad8620
Merge #12653: Allow to optional specify the directory for the blocks storage
a192636 -blocksdir: keep blockindex leveldb database in datadir (Jonas Schnelli)
f38e4fd QA: Add -blocksdir test (Jonas Schnelli)
386a6b6 Allow to optional specify the directory for the blocks storage (Jonas Schnelli)

Pull request description:

  Since the actual block files taking up more and more space, it may be desirable to have them stored in a different location then the data directory (use case: SSD for chainstate, etc., HD for blocks).

  This PR adds a `-blocksdir` option that allows one to keep the blockfiles and the blockindex external from the data directory (instead of creating symlinks).

  I fist had an option to keep the blockindex within the datadir, but seems to make no sense since accessing the index will (always) lead to access (r/w) the block files.

Tree-SHA512: f8b9e1a681679eac25076dc30e45e6e12d4b2d9ac4be907cbea928a75af081dbcb0f1dd3e97169ab975f73d0bd15824c00c2a34638f3b284b39017171fce2409
2020-10-14 13:26:32 -04:00
UdjinM6
74f4d2a898
Merge pull request #3682 from xdustinface/backport-10244-18123
backport: bitcoin#10244, bitcoin#18123, bitcoin#12906 + Parts of bitcoin#11403
2020-10-14 20:22:55 +03:00
xdustinface
7cf7b53375 wallet: Respect chainlocks in CMerkleTx::IsLockedByInstantSend 2020-10-14 12:53:11 +01:00
xdustinface
4dca83ba25 wallet: Add CL/IS caches in CMerkleTx 2020-10-14 12:53:11 +01:00
UdjinM6
12c840f8ce Add mempool lock for Create/CommitTransaction in wallet interface
This is required to fix a (potential) deadlock
2020-10-14 12:53:11 +01:00
xdustinface
5020a68f33 qt|interfaces: Avoid redundant status update calls
- Call `statusUpdateNeeded` before `tryGetTxStatus`. This allows to run
the latter only if really required i.e. if `statusUpdateNeeded` returns true.
- Reuse `cachedNumBlocks` from `WalletModel` in `TransactionTablePriv::index()` to _actually_ avoid redundant tx status updates
- Initialize `cachedNumBlocks` and `cachedChainLockHeight` with `-1` to avoid extra `pollBalanceChanged` call
2020-10-14 12:49:36 +01:00
xdustinface
cee8c151fa scripted-diff: Merge #12906: Avoid interface keyword to fix windows gitian build
17780d6f35 scripted-diff: Avoid `interface` keyword to fix windows gitian build (Russell Yanofsky)

Pull request description:

  Rename `interface` to `interfaces`

  Build failure reported by ken2812221 in https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-379434756

Tree-SHA512: e02c97c728540f344202c13b036f9f63af23bd25e25ed7a5cfe9e2c2f201a12ff232cc94a93fbe37ef6fb6bf9e036fe62210ba798ecd30de191d09338754a8d0

-BEGIN VERIFY SCRIPT-
git mv src/interface src/interfaces
ren() { git grep -l "$1" | xargs sed -i "s,$1,$2,g"; }
ren interface/            interfaces/
ren interface::           interfaces::
ren BITCOIN_INTERFACE_    BITCOIN_INTERFACES_
ren "namespace interface" "namespace interfaces"
-END VERIFY SCRIPT-
2020-10-14 12:10:12 +01:00
xdustinface
7ab1051bf0 Partially backport bitcoin#11403 2020-10-14 12:10:11 +01:00
xdustinface
79d32b5b9e test: Fix wallet tests 2020-10-14 12:10:11 +01:00
Jonas Schnelli
7c6cecaf29 Merge #18123: gui: Fix race in WalletModel::pollBalanceChanged
bf36a3ccc212ad4d7c5cb8f26d7a22e279fe3cec gui: Fix race in WalletModel::pollBalanceChanged (Russell Yanofsky)

Pull request description:

  Poll function was wrongly setting cached height to the current chain height instead of the chain height at the time of polling.

  This bug could cause balances to appear out of date, and was first introduced a0704a8996 (diff-2e3836af182cfb375329c3463ffd91f8L117). Before that commit, there wasn't a problem because cs_main was held during the poll update.

  Currently, the problem should be rare. But if 8937d99ce81a27ae5e1012a28323c0e26d89c50b from #17954 were merged, the problem would get worse, because the wrong cachedNumBlocks value would be set if the wallet was polled in the interval between a block being connected and it processing the BlockConnected notification.

  MarcoFalke also points out that a0704a8996 could lead to GUI hangs as well, because previously the pollBalanceChanged method, which runs on the GUI thread, would only make a nonblocking TRY_LOCK(cs_main) call, but after could make blocking LOCK(cs_main) calls, potentially locking up the GUI.

  Thanks to John Newbery for finding this bug this while reviewing https://github.com/bitcoin/bitcoin/pull/17954.

ACKs for top commit:
  Empact:
    utACK bf36a3ccc2
  jonasschnelli:
    utACK bf36a3c

Tree-SHA512: 1f4f229fa70a6d1fcf7be3806dca3252e86bc1755168fb421258389eb95aae67f863cb1216e6dc086b596c33560d1136215a4c87b5ff890abc8baaa3333b47f4
2020-10-14 12:10:11 +01:00
xdustinface
6088650438 test: Add boost/signals2/connection.hpp to lint-inlcudes.sh 2020-10-14 12:10:11 +01:00
xdustinface
1a5a1ca78a interface/qt: Remove direct src/privatesend calls
Refactored into interface::PrivateSend::Options and
interface::PrivateSend::Client
2020-10-14 12:09:45 +01:00
UdjinM6
eeadfe4d0b
Merge branch 'master' into merge_master_0.16.0.1 2020-10-14 03:53:50 +03:00
UdjinM6
25e26ae76f
rpc: Do not require a privkey corresponding to ownerAddress in protx register_* to be known by the wallet
This requirement was introduced in the initial implementation when we were signing protx payload with the owner key (#2246). This was changed later when we implemented external collateral references (#2366). The owner key is not used for anything in ProTxReg but to get CKeyID since then which we can do by simply decoding an address instead. This simplifies masternode registration process by letting an Operator to issue `protx register_prepare` on its own instead of asking an Owner. An Owner still have to sign the message provided by an Operator with his collateral address to prove collateral ownership (and authorize masternode registration).

Note: `protx register_*` rpc will no longer accept privkeys for ownerAddress. Some 3-rd party software like DMT might need to be patched to work correctly with nodes running with this fix.
2020-10-13 19:19:52 +03:00
Konstantin Shuplenkov
5f2305e5c8
build: create mountpoint for named volume (#3765) 2020-10-08 14:34:33 +03:00
xdustinface
555a184a6a interface/qt: Remove direct src/masterode calls
Refactored into interface::Node::Masternode
2020-10-05 15:41:38 +02:00
xdustinface
e24b6228ad interface/qt: Remove direct src/llmq calls
Refactored into interface::Node::LLMQ
2020-10-05 15:13:34 +02:00
xdustinface
6c900725c2 interface/qt: Remove direct src/evo calls
Refactored into interface::Node::EVO
2020-10-05 15:13:34 +02:00
xdustinface
3139459c71 qt|privatesend: Remove unused wallet inlcudes 2020-10-05 15:13:34 +02:00
xdustinface
07600d9aa7 qt: Cleanup in OptionsDialog
Made node sense to squash it into the related OptionsDialog commit of
the initial PR because this diff uses the wallet interface which gets
introduced one commit after the related commit.
2020-10-05 15:13:34 +02:00
Russell Yanofsky
ce41506a3e Add developer notes about blocking GUI code 2020-10-05 15:13:34 +02:00
Russell Yanofsky
1133dfc1ce Use WalletBalances struct in Qt
Suggested by John Newbery <john@johnnewbery.com>
https://github.com/bitcoin/bitcoin/pull/10244#discussion_r177504284
2020-10-05 15:13:34 +02:00
Russell Yanofsky
8549622027 Remove direct bitcoin calls from qt/sendcoinsdialog.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
e4e00cbbdd Remove direct bitcoin access from qt/guiutil.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
155324e867 Remove direct bitcoin calls from qt transaction table files 2020-10-05 15:13:34 +02:00
Russell Yanofsky
b2f7e1d1eb Remove direct bitcoin calls from qt/paymentserver.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
50f7d661ab Remove direct bitcoin calls from qt/addresstablemodel.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
7bb2d25c3d Remove direct bitcoin calls from qt/coincontroldialog.cpp 2020-10-05 15:13:34 +02:00
Russell Yanofsky
bda6fc4be9 Remove most direct bitcoin calls from qt/walletmodel.cpp 2020-10-05 15:13:31 +02:00
PastaPastaPasta
204df7bc6e
update public part of windows code signing certificate (#3749)
* update public part of windows code signing certificate

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

* Fixing line-breaks

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-10-05 14:57:01 +03:00
Oleg Girko
ba35dae02d
depends: Update Qt download url. (#3756)
Signed-off-by: Oleg Girko <ol@infoserver.lv>

Co-authored-by: Oleg Girko <ol@infoserver.lv>
2020-10-05 14:56:15 +03:00
Russell Yanofsky
6298c97c29 Remove direct bitcoin calls from qt/optionsdialog.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
a19c1f8b88 Remove direct bitcoin calls from qt/rpcconsole.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
80286d777a Remove direct bitcoin calls from qt/bantablemodel.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
59cec79288 Remove direct bitcoin calls from qt/peertablemodel.cpp 2020-10-05 02:01:17 +02:00
Russell Yanofsky
5512eca39c Remove direct bitcoin calls from qt/intro.cpp 2020-10-05 02:01:15 +02:00
Russell Yanofsky
7fe386a00f Remove direct bitcoin calls from qt/clientmodel.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
2856f46424 Remove direct bitcoin calls from qt/splashscreen.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
2fdf3d8c64 Remove direct bitcoin calls from qt/utilitydialog.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
50f1a6205e Remove direct bitcoin calls from qt/bitcoingui.cpp 2020-10-03 21:36:31 +02:00
Russell Yanofsky
f45e095566 Remove direct bitcoin calls from qt/optionsmodel.cpp 2020-10-03 21:36:27 +02:00
Russell Yanofsky
e709f5a45e Remove direct bitcoin calls from qt/bitcoin.cpp 2020-10-03 21:17:37 +02:00
Russell Yanofsky
98473af332 Add src/interface/README.md 2020-10-03 21:17:37 +02:00
dustinface
b8d1a4f315
qt: Make sure there is a valid theme set in the options (#3755)
* qt: Add GUIUtil::isValidTheme()

Check if a given string is a valid theme.

* qt: Make sure there is a valid theme set in the options
2020-10-02 22:50:17 +03:00
PastaPastaPasta
b3c8306867
Make the build an actual release (#3753)
* Make the build an actual release

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

* bump build version

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

* bump diff version

Signed-off-by: pasta <pasta@dashboost.org>
2020-09-30 19:58:44 +03:00
thephez
bc9fa667e5
docs: Several more suggestions (#3751) 2020-09-30 19:52:42 +03:00
UdjinM6
81ce9c451a
qt: More asset cleanup (#3735)
* Drop icon sources (svg) we no longer use

* Rename some icons to better match their content

* Drop chevron/console prompt icon

We do not show it in Dash specific themes and Traditional is just fine with a simple ">" label

* bitcoin -> dash for icons

* Adjust `contrib/debian/copyright`

Dashify it + we no longer use icons mentioned there

* `mogrify src/qt/res/*/*.png`

* `python3 contrib/devtools/optimize-pngs.py`

Total reduction: 68072 bytes
2020-09-30 16:08:11 +03:00