Commit Graph

12941 Commits

Author SHA1 Message Date
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
MarcoFalke 386245e164
mempool: Replace maxFeeRate of 10000*minRelayTxFee with maxTxFee 2019-12-17 12:18:50 -06:00
MarcoFalke 2187f93703
HelpMessage: Don't hide -mintxfee behind showDebug 2019-12-17 12:18:50 -06:00
MarcoFalke ef44c39377
rpcwallet: Clarify what settxfee does 2019-12-17 12:18:50 -06:00
MarcoFalke da468e346a
contrib: Del. gitian downloader config and update gitian README 2019-12-17 12:18:50 -06:00
MarcoFalke 4db07b29c8
[trivial] init: Use defaults MIN_RELAY_TX_FEE & TRANSACTION_MAXFEE 2019-12-17 12:18:50 -06:00
MarcoFalke cbdceb0b28
transaction_tests: Be more strict checking dust
* Don't allow off-by-one or more
* Make clear dust is coupled with minRelayTxFee
* Check rounding for odd values
2019-12-17 12:18:50 -06:00
MarcoFalke f4b9c3283d
translations: Don't translate markdown or force English grammar 2019-12-17 12:18:50 -06:00
MarcoFalke ab77f894b7
Clarify what minrelaytxfee does 2019-12-17 12:18:50 -06:00
MarcoFalke e255b2c278
[qt] Properly display required fee instead of minTxFee
Zcash: Only includes non-QT parts
2019-12-17 12:18:50 -06:00
MarcoFalke e3bdf82dc2
Init: Use DEFAULT_TRANSACTION_MINFEE in help message 2019-12-17 12:18:50 -06:00
MarcoFalke a68e4de2b5
[wallet] Add comments for doxygen 2019-12-17 12:18:50 -06:00
MarcoFalke baeb14ed6f
[wallet] Refactor to use new MIN_CHANGE
* Introduce new constant MIN_CHANGE and use it instead of the
hardcoded "CENT"
* Add test case for MIN_CHANGE
* Introduce new constant for -mintxfee default:
  DEFAULT_TRANSACTION_MINFEE = 1000
2019-12-17 12:18:50 -06:00
MarcoFalke 3de455e138
[trivial] init cleanup 2019-12-17 12:18:50 -06:00
Ian T ab95656549
Update RPC generate help for numblocks to include required
The `generate` RPC has no default `numblocks` and a numeric value is required.
2019-12-17 12:18:50 -06:00
Homu 63c3d1ec94 Auto merge of #4227 - str4d:2074-scripts-1, r=str4d
Bitcoin script PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6335
- bitcoin/bitcoin#6424
- bitcoin/bitcoin#11058
- bitcoin/bitcoin#12460
- bitcoin/bitcoin#13194

Part of #2074.
2019-12-17 17:05:58 +00:00
str4d 31e1ea63e1
Apply suggestions from code review
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
2019-12-17 11:05:28 -06:00
Homu e51e21c3f0 Auto merge of #4261 - str4d:4217-z_mergetoaddress-release-notes, r=str4d
Add z_mergetoaddress to release notes

Closes #4217.
2019-12-13 18:59:50 +00:00
Jack Grigg 5746704b4b
Add z_mergetoaddress to release notes 2019-12-11 23:41:53 +00:00