Commit Graph

12909 Commits

Author SHA1 Message Date
Homu 043ce3f2ac Auto merge of #3912 - bitcartel:fix_getwalletinfo_help_message, r=daira
Closes #3911. Fix help message of RPC getwalletinfo.
2020-01-06 04:37:09 +00:00
Homu efab5aaca4 Auto merge of #4281 - LarryRuane:test-fixes-enable-debug, r=daira
fix tests for enable-debug build

Addresses part of #4275.
2020-01-06 03:29:34 +00:00
Homu 6a08c22567 Auto merge of #4277 - sandakersmann:master, r=daira
Update copyright year to 2020

Update copyright year to 2020
2020-01-05 20:49:00 +00:00
Larry Ruane 7b5148cc64 fix tests for enable-debug build 2019-12-31 12:18:16 -07:00
Homu 1da79ed1c3 Auto merge of #4278 - LarryRuane:4223-fix-spentindex-test, r=daira
insightexplorer: LOCK(cs_main) during rpcs

Closes #4223. Ensure lock cs_main is held during calls to GetSpentIndex().
2019-12-28 14:43:08 +00:00
Larry Ruane 14ec1016b9 insightexplorer: LOCK(cs_main) during rpcs 2019-12-27 10:21:46 -07:00
sandakersmann 0859ea4951
Update _COPYRIGHT_YEAR in configure.ac to 2020 2019-12-27 18:04:14 +01:00
sandakersmann 91b8de9151
Update COPYRIGHT_YEAR in clientversion.h to 2020 2019-12-27 18:01:51 +01:00
sandakersmann 4dd8cf1fc2
Update of copyright year to 2020 2019-12-27 17:58:48 +01:00
Homu 5177d2e708 Auto merge of #4259 - rex4539:fix-warnings, r=daira
depends macOS: hide linker visibility warnings

Closes https://github.com/zcash/zcash/issues/4255

Tested that all lines with `ld: warning: direct access in` are gone from build log.
2019-12-19 16:37:32 +00:00
Homu 900ed4555f Auto merge of #4271 - str4d:2074-wallet-3, r=ebfull
Bitcoin wallet PRs 3

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7687
- bitcoin/bitcoin#11116
  - Excludes SegWit tests
  - Excludes `isInvalid` code (which is part of the SegWit support structure)
- bitcoin/bitcoin#13002
  - Excludes changes to `importwallet` (missing bitcoin/bitcoin#11667)
  - Excludes changes to `ProcessImport` (missing bitcoin/bitcoin#7551)
  - Third commit was rewritten to add an internal SigVersion argument (which we didn't have because it was added to support SegWit logic).
2019-12-19 01:17:12 +00:00
Pieter Wuille 82eefce0ab
Use anonymous namespace instead of static functions 2019-12-18 18:59:15 -06:00
Pieter Wuille 790f21e9a8
Mention removal of bare multisig IsMine in release notes 2019-12-18 18:59:15 -06:00
Pieter Wuille e82901f4fd
Do not treat bare multisig as IsMine
Such outputs can still be watched, and signed for, but they aren't treated as valid payments.
That means they won't cause transactions to appear in listtransactions, their outputs to be
shown under listunspent, or affect balances.
2019-12-18 18:59:15 -06:00
Pieter Wuille 84b4bdbb51
Track difference between scriptPubKey and P2SH execution in IsMine
Inside IsMine we care about the distinction between scriptPubKey execution
and P2SH redeemScript execution. The consensus code does not care about this
distinction, and thus SigVersion does not have a field for P2SH. As the IsMine
code will care, it uses a separate enum with more fields.
2019-12-18 18:59:15 -06:00
Pieter Wuille 36f067bb95
Switch to a private version of SigVersion inside IsMine
This will allow us to have the consensus code and IsMine code diverge.
2019-12-18 18:59:15 -06:00
Pieter Wuille 030e173d98
Do not expose SigVersion argument to IsMine
Only IsMine's internal code needs this, as part of a recursion into P2SH and P2WSH
scripts. The exposed functions always operate on actual scriptPubKeys and not on
redeemScripts or witness scripts.

Zcash: Rewrote this commit so that it instead adds an internal
SigVersion argument (which we didn't have because it was added to
support SegWit logic).

Co-authored-by: Jack Grigg <jack@z.cash>
2019-12-18 18:59:15 -06:00
Pieter Wuille df00e51e3e
Make CScript -> CScriptID conversion explicit
Zcash: Excludes changes to importwallet (missing bitcoin/bitcoin#11667)
and ProcessImport (missing bitcoin/bitcoin#7551).
2019-12-18 18:59:15 -06:00
Jim Posen de9c679770
[script] Unit tests for IsMine
Does not test watch-only addresses.

Zcash: Excluding SegWit tests and isInvalid code (which is part of the
SegWit support structure).
2019-12-18 18:59:15 -06:00
Jim Posen bf2c8b3bc6
[script] Unit tests for script/standard functions
Zcash: Excluding unit tests for SegWit logic.
2019-12-18 18:59:15 -06:00
Pieter Wuille 9ed1fe9c6b
Stop treating importaddress'ed scripts as change
Before this, if someone imported a scriptPubKey directly (in hex form) using
importaddress, outputs sending to it would be treated as change, as the
corresponding CTxDestination was not added to the address book.

Fix this by trying to detect scriptPubKeys that are in fact convertible to a
CTxDestination and add them anyway. Add a warning to the RPC help to warn
against importing raw non-standard scripts.
2019-12-18 18:59:15 -06:00
Homu fa341bcff0 Auto merge of #4270 - str4d:2074-wallet-2, r=str4d
Bitcoin wallet PRs 2

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7576
- bitcoin/bitcoin#7577
- bitcoin/bitcoin#7608
- bitcoin/bitcoin#7691
- bitcoin/bitcoin#7905
2019-12-18 23:53:21 +00:00
Wladimir J. van der Laan e42359dcbf
test: Rename wallet.dat to wallet_test.dat
Indicate that the file name is not hardcoded, and a little bit of safety
so that it never nukes the main wallet.

Suggestion by Marco Falke.
2019-12-18 16:50:29 -06:00
Wladimir J. van der Laan 3782c4d6ab
wallet_ismine.h → script/ismine.h
Removes conditional dependency of `src/test` on wallet.

Makes multisig and P2SH tests complete without wallet built-in.
2019-12-18 16:50:29 -06:00
Wladimir J. van der Laan 91f0b506ca
test: Create test fixture for wallet
Removes all the `#ifdef ENABLE_WALLET` from `test_bitcoin` by
making the wallet tests use their own fixture.
2019-12-18 16:50:29 -06:00
Wladimir J. van der Laan 994a51d4d7
test: move accounting_tests and rpc_wallet_tests to wallet/test
Move the two other wallet tests to where they belong.
2019-12-18 16:50:29 -06:00
Jonas Schnelli 6c1b6c8ccc
[Wallet] refactor wallet/init interaction 2019-12-18 16:50:29 -06:00
MarcoFalke 8822e4e135
[wallet] Move hardcoded file name out of log messages 2019-12-18 16:50:29 -06:00
Jonas Schnelli 5b376b5125
[Wallet] optimize return value of InitLoadWallet() 2019-12-18 16:50:29 -06:00
Jonas Schnelli c3ca0163a8
[Wallet] move "load wallet phase" to CWallet
Zcash: Modified to move our modifications to "load wallet phase".
2019-12-18 16:50:29 -06:00
Jonas Schnelli 8dacb764bc
[Wallet] move wallet help string creation to CWallet 2019-12-18 16:50:29 -06:00
Homu 0a31c163c6 Auto merge of #4252 - str4d:wallet-interface-refactor, r=str4d
Wallet interface refactor

This refactors the logic introduced in #4144 to improve the separation between the node and wallet. The notifier thread now lives next in `src/validationinterface.cpp` directly next to the existing `CMainSignals` node-wallet interface.

Part of #3877.
2019-12-18 22:48:26 +00:00
Homu 577f7ef72a Auto merge of #4268 - str4d:2074-cleanup-2, r=str4d
Bitcoin 0.12 cleanup PRs 2

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6631
- bitcoin/bitcoin#6664
  - Only the first commit (we already had the second through bitcoin/bitcoin#6825).
- bitcoin/bitcoin#6669
- bitcoin/bitcoin#6887
  - Only the non-QT parts.
- bitcoin/bitcoin#6962
- bitcoin/bitcoin#6822
  - Only first and third commits (we already had the second through an earlier PR).
- bitcoin/bitcoin#7136
  - Excludes Travis CI changes, and fixes to documents we don't have anymore.
- bitcoin/bitcoin#7084
- bitcoin/bitcoin#7509
- bitcoin/bitcoin#7617
- bitcoin/bitcoin#7726

Part of #2074.
2019-12-18 21:44:58 +00:00
Jack Grigg f93db1219b
test: Update wallet RPC test with change to "absurdly high fee" limit 2019-12-18 15:40:50 -06:00
Jack Grigg e77e8660e3
test: Add missing sync_all point
This file was renamed in master, so it was missed in the first commit.
2019-12-18 15:06:54 -06:00
Jack Grigg 4f6b477fb6
test: Reverse hashtx and hashblock ordering at start of ZMQ RPC test
The "hashtx" message was previously triggered synchronously inside
ConnectBlock, while the "hashblock" message is triggered in ConnectTip
immediately after ConnectBlock returns. Thus ZMQ would see a "hashtx"
for every relevant transaction, followed by a "hashblock".

Now, "hashtx" is triggered asynchronously once the cs_main lock is
dropped, which does not occur until after ConnectTip returns. Thus ZMQ
will see a "hashblock" immediately after the block is connected, and
then a "hashtx" for relevant transactions at some point afterwards.
2019-12-18 15:06:54 -06:00
Jack Grigg d57af95802
test: Remove genesis-block Sapling activation from shorter_block_times
Sapling can't be activated in the genesis block without recomputing it,
and we already activate Sapling by default in block 1, which is fine for
this RPC test.
2019-12-18 15:06:54 -06:00
Jack Grigg f7eaf921bc
test: Add sync_all points after block generation to RPC tests
Previously we only required synchronization points where blocks were
sent between nodes; now we need them between action and query operations
on the same node, because wallet notification of mined blocks no longer
occurs in real-time.
2019-12-18 15:06:54 -06:00
Jack Grigg 8af85a0d10
Extend comment with reason for taking care with locks 2019-12-18 15:06:54 -06:00
Jack Grigg 03db5c8ca3
Tie sync_blocks in RPC tests to notifier thread 2019-12-18 15:06:54 -06:00
Jack Grigg 9771506acd
Move block-notifying logic into ThreadNotifyWallets 2019-12-18 15:06:54 -06:00
Jack Grigg a71a7341b9
Merge tree and boolean fields in ChainTip API
The trees were being unnecessarily fetched during DisconnectTip.
2019-12-18 15:06:54 -06:00
Jack Grigg a28916d273
Move mempool tx notifying logic out of CTxMemPool
ThreadNotifyWallets now collects all notification-related state at once,
and then executes wallet logic based on the collected state after
dropping any locks it is holding.
2019-12-18 15:06:54 -06:00
Jack Grigg 2c8dff00cc
ThreadNotifyRecentlyAdded -> ThreadNotifyWallets 2019-12-18 15:06:54 -06:00
Denis Lukianov 136e1c09ab
Correct importaddress help reference to importpubkey 2019-12-17 12:18:50 -06:00
MarcoFalke 49a2cbee98
Make sure LogPrintf strings are line-terminated 2019-12-17 12:18:50 -06:00
MarcoFalke 6d2629dd64
[doc] Fix markdown 2019-12-17 12:18:50 -06:00
MarcoFalke f4caccc6ef
Fix doxygen comment for payTxFee 2019-12-17 12:18:50 -06:00
Luke Dashjr 996d6c3f54
Common argument defaults for NODE_BLOOM stuff and -wallet 2019-12-17 12:18:50 -06:00
MarcoFalke 9e4362a486
[doxygen] Actually display comment 2019-12-17 12:18:50 -06:00