Commit graph

29477 commits

Author SHA1 Message Date
Hennadii Stepanov
38eb37c0bd
qt, rpc: Do not accept command while executing another one 2021-05-31 23:34:04 +03:00
Hennadii Stepanov
0c32b9c527
qt, rpc: Accept stop RPC even another command is executing
While here, clean up the command input by calling the trimmed function
on the input from the command prompt.
2021-05-31 23:34:04 +03:00
Hennadii Stepanov
ccf790287c
qt, rpc, refactor: Return early in RPCConsole::on_lineEdit_returnPressed 2021-05-31 23:32:59 +03:00
Hennadii Stepanov
5b9c8c9cdd
qt, rpc: Add "Executing…" message 2021-05-31 23:31:32 +03:00
MarcoFalke
933c6466c2
Merge bitcoin/bitcoin#22109: doc: Fix external links (IRC, ...)
9999e4c64b doc: Fix external links (IRC, ...) (MarcoFalke)

Pull request description:

  The freenode channel was deleted by their staff. Fix that by moving to libera chat.

  Also includes minor cosmetic fixups 🐷 💅

ACKs for top commit:
  hebasto:
    re-ACK 9999e4c64b, agree with the recent changes.
  kristapsk:
    re-ACK 9999e4c64b
  theStack:
    ACK 9999e4c64b
  jarolrod:
    ACK 9999e4c64b

Tree-SHA512: 67886783b1239153ac1631f6594fc2f873760da3c63aca400c0a84f852418d0e28de0400310f4d8b8fe213b7d4d243600607acc4a48c1662f9848f254c946cab
2021-05-31 21:12:46 +02:00
Sebastian Falbesoner
7e32fde912 test: feature_cltv.py: don't return tx copies in modification functions
The functions cltv_modify_tx(), cltv_invalidate() and cltv_validate()
all modify the passed transaction in-place, i.e. there is no need
to return a copy.
2021-05-31 19:47:30 +02:00
Sebastian Falbesoner
9ab2ce0a66 test: drop unused node parameters in feature_cltv.py
The following functions had a parameter "node" that is unsused
and hence can be removed:
    - cltv_modify_tx()
    - cltv_invalidate()
    - cltv_validate()
2021-05-31 19:34:00 +02:00
Sebastian Falbesoner
0c2139a3f1 test: fix typo in feature_cltv.py (s/ctlv/cltv/) 2021-05-31 19:18:04 +02:00
Hennadii Stepanov
11225905b7
Merge bitcoin-core/gui#309: Add access to the Peers tab from the network icon
d29ea72393 gui: Add access to the Peers tab from the network icon (Hennadii Stepanov)

Pull request description:

  This PR add a small context menu to the network activity icon that provides an access to the Peers tab:

  ![gui-network-icon](https://user-images.githubusercontent.com/32963518/116794314-d64b9b80-aad4-11eb-89ca-7f75c7442ba8.gif)

  Closes #93.

ACKs for top commit:
  Sjors:
    re-ACK d29ea72393
  kristapsk:
    re-ACK d29ea72393
  promag:
    Code review ACK d29ea72393.

Tree-SHA512: dd871415fe514a19c6a22100d58f31954d9e55b80585d5a3f26e17a8d51dadf912441786fc0d23beabd812f1b501658fec1dbe345cd41beae5832a8eda890f77
2021-05-31 19:37:44 +03:00
Darius Parvin
a3f0cbf82d test: run mempool_reorg.py even with wallet disabled
- run mempool_reorg.py even when the wallet is not compiled
- add `locktime` argument to `create_self_transfer` and `send_self_transfer`
- use more logs instead of comments
2021-05-31 09:28:10 -07:00
MarcoFalke
9999e4c64b
doc: Fix external links (IRC, ...) 2021-05-31 17:27:57 +02:00
MarcoFalke
ffff0d0442
refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
MarcoFalke
8462cd5601
Merge bitcoin/bitcoin#22080: doc: add maxuploadtarget to bitcoin.conf example
947f9734da doc: add maxuploadtarget to bitcoin.conf example (apitko)

Pull request description:

  picking up #21499, author has stated they [can't squash](https://github.com/bitcoin/bitcoin/pull/21499#issuecomment-849277632).

  This adds the maxuploadtarget option to the `bitcoin.conf` example file. This is useful for those looking to configure their bandwidth utilization.

  **Changes from Original PR:**
  - squash commits
  - fix typo in commit message + reword commit message to be more appropriate
  - Implement review suggestions ([1](https://github.com/bitcoin/bitcoin/pull/21499#discussion_r615409982), [2](https://github.com/bitcoin/bitcoin/pull/21499#discussion_r615410337), [3](https://github.com/bitcoin/bitcoin/pull/21499#pullrequestreview-659357756))
  - Fix spacing

ACKs for top commit:
  jonatack:
    ACK 947f9734da
  theStack:
    re-ACK 947f9734da

Tree-SHA512: 658ce6e1f204cd1c1c6f8977fd46ba1631f417d3f492e6d777b0ca49ffecc2ecfa4fbd86ca0e08c0dd5d6df4e32f0b56693e0a71bd7eafafd019e93bbcf9420f
2021-05-31 13:59:51 +02:00
MarcoFalke
8c6df2b4ca
Merge bitcoin/bitcoin#22095: test: Additional BIP32 test vector for hardened derivation with leading zeros
91ef8344d4 Additional test vector for hardened derivation with leading zeros (Kristaps Kaupe)

Pull request description:

  See [Inconsistent BIP32 Derivations](https://blog.polychainlabs.com/bitcoin,/bip32,/bip39,/kdf/2021/05/17/inconsistent-bip32-derivations.html) and https://github.com/bitcoin/bips/pull/1030.

ACKs for top commit:
  practicalswift:
    cr ACK 91ef8344d4
  sipa:
    ACK 91ef8344d4. Verified that it matches the linked BIP32 update, and that it indeed tests derivation from a private key with leading 0 byte.

Tree-SHA512: 0a3ae7aed15e4e08e9bec5db8de53c6c03ed3b3632f390394eea422597755173cbd2228ff0cfa57f5aae3df9d4cdf03a8ef4725cc8bce86ab7d9c82ab9d479ad
2021-05-31 13:46:42 +02:00
MarcoFalke
c5ee0cc11a
Merge bitcoin/bitcoin#21989: test: Use COINBASE_MATURITY in functional tests
bfa9309ad6 Use COINBASE_MATURITY constant in functional tests. (Kiminuo)
525448df9d Move COINBASE_MATURITY from `feature_nulldummy` test to `blocktools`. (Kiminuo)

Pull request description:

  `COINBASE_MATURITY` constant was added to `feature_nulldummy` test in #21373. This PR moves the constant to `blocktools.py` file and uses the constant in more tests as suggested [here](https://github.com/bitcoin/bitcoin/pull/21373#discussion_r605418462).

  Edit: Goal of this PR is to replace integer constants with `COINBASE_MATURITY` but not necessarily in *all* cases because that would mean to read and fully understand all tests. That's out of my time constraints. Any reports where `COINBASE_MATURITY` should be used are welcome though!

ACKs for top commit:
  theStack:
    ACK bfa9309ad6 🌇

Tree-SHA512: 01f04645f05a39028681f355cf3d42dd63ea3303f76d93c430e0fdce441934358a2d847a54e6068d61932f1b75e1d406f51859b057b3e4b569f7083915cb317f
2021-05-31 11:26:25 +02:00
fanquake
feb72e5432
scripted-diff: rename GetSystemTimeInSeconds to GetTimeSeconds
-BEGIN VERIFY SCRIPT-
sed -i -e 's/GetSystemTimeInSeconds/GetTimeSeconds/g' $(git grep -l GetSystemTimeInSeconds src)
-END VERIFY SCRIPT-
2021-05-31 15:11:18 +08:00
fanquake
e12f287498
net: cleanup newly added PeerManagerImpl::ProcessNewBlock
Addresses some post-merge comments.
2021-05-31 14:36:46 +08:00
fanquake
610151f5b0
validation: change ProcessNewBlock() to take a CBlock reference
Update ProcessNewBlock arguments to newer style.
2021-05-31 14:36:46 +08:00
Kiminuo
bfa9309ad6 Use COINBASE_MATURITY constant in functional tests. 2021-05-31 07:32:28 +02:00
MarcoFalke
d7a6bba949
Merge bitcoin/bitcoin#22103: test: Fix IPv6 check on BSD systems
2be3572506 test: Fix IPv6 check on BSD systems (nthumann)

Pull request description:

  I noticed that `test_ipv6_local()` always returns `False` on macOS or FreeBSD, even though IPv6 is working perfectly fine. This causes `test/functional/rpc_bind.py --ipv6` and `test/functional/feature_proxy.py` to skip their run.
  Apparently, there's a check if the port number is `0` (see [here](64881da478/sys/netinet6/udp6_usrreq.c (L248)) or [here](8f02f2a044/bsd/netinet6/udp6_usrreq.c (L282))), while Linux has no problem with this.
  This is fixed by specifying any other port number than `0`, e.g. `1`. Still, because of `SOCK_DGRAM`, no actual connection is made.

ACKs for top commit:
  fanquake:
    ACK 2be3572506 - nice improvement. I checked that with this change ipv6 related tests in `feature_proxy.py` are being run.
  theStack:
    ACK 2be3572506

Tree-SHA512: 8417c2d3cf71050529f3fa409a03872040fe5d249eae4172f276e62156e505a20d375b963712a186c9ad7967d8a497b5900d327c74a9693f68c33063871d4691
2021-05-31 07:24:54 +02:00
fanquake
619e930aa1
Merge bitcoin/bitcoin#22070: build: don't use cf-protection when targeting arm-apple-darwin
3caedb4c03 build: don't use cf-protection when targeting arm-apple-darwin (fanquake)

Pull request description:

  After two reports on IRC of issues building depends on an Apple M1 machine, this option (obviously) can't be used when targeting `arm-apple-darwin`.  For now, just use it for `x86_64-apple-darwin`.

  ```bash
  Apple clang version 12.0.5 (clang-1205.0.22.9)
  Target: x86_64-apple-darwin20.4.0

  error: option 'cf-protection=return' cannot be specified on this target
  error: option 'cf-protection=branch' cannot be specified on this target
  2 errors generated.
  ```

ACKs for top commit:
  promag:
    Tested ACK 3caedb4c03.

Tree-SHA512: 8763a5b94000016b0c2f0438e66002fdfcd2cbafd9d2d2acc1972f0c6f707e820186711dbd9d3f72673c179718da75588acb4732f8d84b85f0c1dfc862b6e944
2021-05-31 10:05:55 +08:00
nthumann
2be3572506
test: Fix IPv6 check on BSD systems 2021-05-30 23:47:50 +02:00
Andrew Chow
96c2c9520e scripted-diff: Rename SelectCoinsMinConf to AttemptSelection
SelectCoinsMinConf is a bit of a misnomer now since it really just does
all of the coin selection given some parameters. So rename this to
something less annoying to say and makes a bit more sense.

-BEGIN VERIFY SCRIPT-
sed -i 's/SelectCoinsMinConf/AttemptSelection/g' $(git grep -l SelectCoinsMinConf ./src)
-END VERIFY SCRIPT-
2021-05-30 14:10:10 -04:00
Andrew Chow
b583f73354 Move vin filling to before final fee setting
It's unnecessary to fill in the vin with dummy inputs, calculate the
fee, then fill in the vin with the actual inputs. Just fill the vin with
the actual inputs the first time.
2021-05-30 14:07:49 -04:00
Andrew Chow
d39cac0547 Set m_subtract_fee_outputs during recipients vector loop
Instead of setting this afterwards based on the results from the loop,
just do it inside of the loop itself.

Fixed some styling nearby
2021-05-30 14:06:40 -04:00
Andrew Chow
364e0698a5 Move variable initializations to where they are used
- txNew nLockTime setting to txNew init
- FeeCalc to the fee estimation fetching
- setCoins to prior to SelectCoins
- nBytes to CalculateMaximumSignedTxSize call
- tx_sizes to CalculateMaximumSignedTxSize call
- coin_selection_params.m_avoid_partial_spends to params init
2021-05-30 14:06:13 -04:00
Andrew Chow
32ab430651 Move recipients vector checks to beginning of CreateTransaction
Ensuring that the recipients vector is not empty and that the amounts
are non-negative can be done in CreateTransaction rather than
CreateTransactionInternal. Additionally, these checks should happen as
soon as possible, so they are done at the beginning of
CreateTransaction.
2021-05-30 14:05:42 -04:00
Andrew Chow
cd1d6d3324 Rename nSubtractFeeFromAmount in CreateTransaction
Renamed to outputs_to_subtract_fee_from for clarity.
2021-05-30 14:05:15 -04:00
Andrew Chow
dac21c793f Rename nValue and nValueToSelect
nValue is the sum of the intended recipient amounts, so name it that for
clarity.

nValueToSelect is the coin selection target value, so name it
selection_target for clarity.
2021-05-30 14:03:43 -04:00
Andrew Chow
d2aee3bbc7 Remove extraneous scope in CreateTransactionInternal
These brackets were restricting a scope for no apparent reason. Remove
them and dedent.
2021-05-30 14:01:29 -04:00
Andrew Chow
b2995963b5 Move cs_wallet lock in CreateTransactionInternal to top of function
It isn't necessary to not lock parts of this function. Just lock the
whole thing and get rid of an indent.
2021-05-30 13:59:32 -04:00
Samuel Dobson
55a156fca0
Merge bitcoin/bitcoin#21207: MOVEONLY: CWallet transaction code out of wallet.cpp/.h
c7bd5842e4 MOVEONLY: CWallet transaction code out of wallet.cpp/.h (Russell Yanofsky)

Pull request description:

  This commit just moves function without making any changes. It can be reviewed with `git log -p -n1 --color-moved=dimmed_zebra`

  Motivation for this change is to make `wallet.cpp/h` less monolithic and start to make wallet transaction state tracking comprehensible so bugs in https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Transaction-Conflict-Tracking can be fixed safely without introducing new problems.

  This moves wallet classes and methods that deal with transactions out of `wallet.cpp/.h` into better organized files:

  - `transaction.cpp/.h` - CWalletTx and CMerkleTx class definitions
  - `receive.cpp/.h` - functions checking received transactions and computing balances
  - `spend.cpp/.h` - functions creating transactions and finding spendable coins

  After #20773, when loading is separated from syncing it will also be possible to move more `wallet.cpp/.h` functions to:

  - `sync.cpp/.h` - functions handling chain notifications and rescanning

  This commit arranges `receive.cpp` and `spend.cpp` functions in dependency order so it's possible to skim `receive.cpp` and get an idea of how computing balances works, and skim `spend.cpp` and get an idea of how transactions are created, without having to jump all over `wallet.cpp` where functions are not in order and there is a lot of unrelated code.

  Followup commit "refactor: Detach wallet transaction methods" in https://github.com/bitcoin/bitcoin/pull/21206 follows up this PR and tweaks function names and arguments to reflect new locations. The two commits are split into separate PRs because this commit is more work to maintain and less work to review, while the other commit is less work to maintain and more work to review, so hopefully this commit can be merged earlier.

ACKs for top commit:
  Sjors:
    re-utACK c7bd5842e4
  fjahr:
    utACK c7bd5842e4
  promag:
    Code review ACK c7bd5842e4, verified move only claim.
  meshcollider:
    Dimmed-zebra-check and functional test run ACK c7bd5842e4

Tree-SHA512: 4981de6911cb1196774db375494355cc9af59b52456129c002d264a77cd9ed6175f8ecbb6b2f492a59a4d5a0def21a39d96fa79c9f4d99be0992985f553be32f
2021-05-30 22:00:40 +12:00
Hennadii Stepanov
be1c512437
Merge bitcoin-core/gui#343: Improve the GUI responsiveness when progress dialogs are used
4935ac583b qt: Improve GUI responsiveness (Hennadii Stepanov)
75850106ae qt, macos: Fix GUIUtil::PolishProgressDialog bug (Hennadii Stepanov)

Pull request description:

  [`QProgressDialog`](https://doc.qt.io/qt-5/qprogressdialog.html) estimates the time the operation will take (based on time for steps), and only shows itself if that estimate is beyond [`minimumDuration`](https://doc.qt.io/qt-5/qprogressdialog.html#minimumDuration-prop).

  The default `minimumDuration` value is [4 seconds](https://doc.qt.io/qt-5/qprogressdialog.html#details), and it could make users think that the GUI is frozen.

  This PR sets `minimumDuration` to zero for all progress dialogs, that affects ones in the `WalletControllerActivity` class.

ACKs for top commit:
  ryanofsky:
    Code review ACK 4935ac583b. I'm not very familiar with this API but all the changes and explanations make sense and are very clear, and this seems like it should be an improvement.
  promag:
    Code review ACK 4935ac583b.
  jarolrod:
    ACK 4935ac583b

Tree-SHA512: 2ddd74e7fd87894d341d2439dbaa544d031a350f7f57d4c7e9fbba977dc24080fe60fd7a80a542b1647f1de9091d7fd04a36eab695088d4d75fb836548e99b5f
2021-05-29 17:15:21 +03:00
Hennadii Stepanov
62cb8d98d2
qt: Drop BitcoinGUI* WalletFrame data member
This changes removes bitcoingui->walletframe->bitcoingui circular
dependency.

This commit does not change behavior.
2021-05-29 15:49:30 +03:00
Hennadii Stepanov
f73e5c972a
qt: Move CreateWalletActivity connection from WalletFrame to BitcoinGUI
This changes remove some pointers to the BitcoinGUI instance that is
required for the next commits.

This commit does not change behavior.
2021-05-29 15:49:30 +03:00
Hennadii Stepanov
20e2e24e90
qt: Move WalletView connections from WalletFrame to BitcoinGUI
This changes remove some pointers to the BitcoinGUI instance that is
required for the next commits.

This commit does not change behavior.
2021-05-29 15:49:29 +03:00
bruno
ef99d03c2b test: check anchors.dat when node starts for the first time 2021-05-28 16:50:07 -03:00
apitko
947f9734da doc: add maxuploadtarget to bitcoin.conf example
Introduce the maxuploadtarget option to the example bitcoin.conf file. This adds visibility for this option which is useful to those looking to configure bandwidth usage.
2021-05-28 12:53:17 -04:00
Hennadii Stepanov
123b401e0a
Merge bitcoin-core/gui#275: Support runtime appearance adjustment on macOS
c231254a65 qt: Make TransactionView aware of runtime palette change (Hennadii Stepanov)
2b622d4ace qt: Make CoinControlDialog aware of runtime palette change (Hennadii Stepanov)
97a6b5e06a qt: Make OverviewPage aware of runtime palette change (Hennadii Stepanov)
d05f1b278d qt: Make UnitDisplayStatusBarControl aware of runtime palette change (Hennadii Stepanov)
6b2ce65392 qt: Replace base class of ClickableLabel with ThemedLabel (Hennadii Stepanov)
ff530a2093 qt: Use GUIUtil::ThemedLabel class (Hennadii Stepanov)
d99ef327a8 qt: Add GUIUtil::ThemedLabel class (Hennadii Stepanov)
c054720e08 qt: Make SignVerifyMessageDialog aware of runtime palette change (Hennadii Stepanov)
0dcc3fac43 qt: Make SendCoinsEntry aware of runtime palette change (Hennadii Stepanov)
fa18d28e12 qt: Make RPCConsole aware of runtime palette change (Hennadii Stepanov)
f1083826e3 qt: Make BitcoinGUI aware of runtime palette change (Hennadii Stepanov)
ce17861dc4 qt: Make PlatformStyle aware of runtime palette change (Hennadii Stepanov)

Pull request description:

  On macOS switching appearance (Light -> Dark or Dark -> Light) when Bitcoin Core is running makes the GUI pretty unusable.
  This bug is especially important when a user chose the "Auto" mode to adjust appearance automatically.

  This PR fixes Bitcoin Core behavior.

  This is an alternative to #268.

ACKs for top commit:
  Sjors:
    tACK c231254a65 on macOS 11.4
  goums:
    ACK c231254a65
  promag:
    Tested ACK c231254a65 on macOS Big Sur arm64.
  jarolrod:
    tACK c231254a65

Tree-SHA512: 122dda3e4c9703f68cec60613c536ca59d04c93f2c03398559f2361b8d279ae534800e8e677d94a33e10e769d00be54295a704e98afa2e986a06146b9f164854
2021-05-28 18:07:44 +03:00
Vasil Dimov
a92485b2c2
addrman: use unordered_map instead of map
`CAddrMan` uses `std::map` internally even though it does not require
that the map's elements are sorted. `std::map`'s access time is
`O(log(map size))`. `std::unordered_map` is more suitable as it has a
`O(1)` access time.

This patch lowers the execution times of `CAddrMan`'s methods as follows
(as per `src/bench/addrman.cpp`):

```
AddrMan::Add(): -3.5%
AddrMan::GetAddr(): -76%
AddrMan::Good(): -0.38%
AddrMan::Select(): -45%
```
2021-05-28 16:40:15 +02:00
Kristaps Kaupe
91ef8344d4
Additional test vector for hardened derivation with leading zeros 2021-05-28 17:22:01 +03:00
fanquake
6c3fcd5591
test: remove BasicTestingSetup from util_threadnames unit tests 2021-05-28 19:14:09 +08:00
fanquake
b53d3c1b1f
test: remove BasicTestingSetup from uint256 unit tests 2021-05-28 19:14:09 +08:00
fanquake
c0497a4928
test: remove BasicTestingSetup from torcontrol unit tests 2021-05-28 19:14:09 +08:00
fanquake
ef8bb0473b
test: remove BasicTestingSetup from sync unit tests 2021-05-28 19:14:09 +08:00
fanquake
1aee83421f
test: remove BasicTestingSetup from reverse_lock unit tests 2021-05-28 19:14:09 +08:00
fanquake
57ba949ef5
test: remove BasicTestingSetup from policy_fee unit tests 2021-05-28 19:14:09 +08:00
fanquake
3974c962b6
test: remove BasicTestingSetup from merkleblock tests 2021-05-28 19:14:08 +08:00
fanquake
cd5bc4b470
test: remove BasicTestingSetup from hash unit tests 2021-05-28 19:14:08 +08:00
fanquake
39cec22935
test: remove BasicTestingSetup from compilerbug unit tests 2021-05-28 19:14:08 +08:00