Commit graph

33018 commits

Author SHA1 Message Date
laanwj
3eec29ed3a
Merge bitcoin/bitcoin#24180: script: Handle request exception and check svg image in getcoins.py
7c7dbe4398 improved getcoins.py (sh15h4nk)

Pull request description:

  Improvement to getcoins.py:
    - handled request excecptions
    - added limit handler to SVG size
    - restricted format
    - added caption to captcha (From the url)

    Fixes https://github.com/bitcoin/bitcoin/issues/24119

ACKs for top commit:
  laanwj:
    Tested ACK 7c7dbe4398

Tree-SHA512: b0311b8d69c604db80b0802659c874760f7c2aa79c1f27637f8c03d0d95516d184514ff226e1ba3e1dcf506f5be4013a2d71e66369e03739a7add0e0ba80190c
2022-02-14 09:12:00 +01:00
fanquake
5d399f9f3d
build: remove native B2 package 2022-02-13 20:59:07 +00:00
fanquake
2037a3b6c1
build: header-only Boost 2022-02-13 20:59:07 +00:00
fanquake
39e66e938f
build: use header-only Boost unit test 2022-02-13 20:59:02 +00:00
sh15h4nk
7c7dbe4398 improved getcoins.py 2022-02-13 22:59:31 +05:30
fanquake
25a91a571a
Merge bitcoin/bitcoin#24276: build, refactor: Improve package version usage
edc9a6afdc build, refactor: Reuse expat package version in its download path (Hennadii Stepanov)
4bb7821ab2 build, refactor: Use conventional version notation for boost package (Hennadii Stepanov)

Pull request description:

  `boost` package:
  - `.` is used as a separator in versions of other depends packages.

  `expat` package:
  - reuse package version in its download path

  ---

  The straightforward way to verify this PR:
  ```
  $ cd depends
  $ make clean-all
  $ make boost_fetched
  $ make expat_fetched
  ```

ACKs for top commit:
  prusnak:
    ACK edc9a6a
  shaavan:
    ACK edc9a6afdc

Tree-SHA512: c15d672fe34ac59850425d3d6a6eee5f720e16d227aad1332a563b218465879b7ee6fb865dd1bac06aedf356f9bb1c67112d9d88da8f877f04838b50a9dc97be
2022-02-13 11:22:36 +00:00
MarcoFalke
b1aa3b1959
Merge bitcoin/bitcoin#24330: doc: release-process: Specify remote name in "git fetch"
876b91c383 release-process: Specify remote name in "git fetch" (Jeremy Rand)

Pull request description:

  Avoids "does not appear to be a git repository" error.

  Fixes #24329

ACKs for top commit:
  shaavan:
    ACK 876b91c383

Tree-SHA512: 0ba23cd51ca761823cab19200b69f07a5c23e1a501114e0af73b24195c306cebb789e187dd436f7b3895a10de31e41276bb2fc4b217cd152247d2704e44bc8da
2022-02-13 08:58:09 +01:00
Jeremy Rand
876b91c383
release-process: Specify remote name in "git fetch"
Avoids "does not appear to be a git repository" error.

Fixes #24329
2022-02-13 06:02:25 +00:00
Hennadii Stepanov
f730bd7d58
scripted-diff: Rename ShowModalDialogAndDeleteOnClose
-BEGIN VERIFY SCRIPT-
sed -i 's/ShowModalDialogAndDeleteOnClose/ShowModalDialogAsynchronously/' -- $(git grep -l -e "ShowModalDialogAndDeleteOnClose")
-END VERIFY SCRIPT-

It is important to highlight that a modal dialog is showed
asynchronously as there are cases when the synchronous QDialog::exec()
is required.
2022-02-12 23:00:45 +02:00
Hennadii Stepanov
5d7666b151
qt: Revert 7fa91e8312 partially
The AskPassphraseDialog modal dialog must be synchronous here as
expected in the WalletModel::requestUnlock() function.

Fixed an introduced regression.
2022-02-12 23:00:45 +02:00
Hennadii Stepanov
89c277a6fc
qt: Delay shutdown while a modal dialog is active 2022-02-12 23:00:45 +02:00
Hennadii Stepanov
8c0eb80f41
qt: Disable tray icon menu when a modal dialog is active 2022-02-12 23:00:44 +02:00
Hennadii Stepanov
92427354dd
qt, refactor: Use local QAction instances for the tray icon menu
This change is required for the following commit.
2022-02-12 23:00:31 +02:00
Hennadii Stepanov
e7fc50681e
qt: Override BitcoinApplication::event() to handle QEvent::Quit 2022-02-12 16:04:57 +02:00
fanquake
b6b7815ddc
Merge bitcoin/bitcoin#24277: build: Fix make deploy for Windows when building out of source tree
a5f67b4ca8 build: Fix `make deploy` for Windows when building out of source tree (Hennadii Stepanov)

Pull request description:

  On master (1e7564eca8):
  ```
  $ make distclean
  $ mkdir ../build
  $ cd ../build
  $ CONFIG_SITE=$PWD/../bitcoin/depends/x86_64-w64-mingw32/share/config.site ../bitcoin/configure
  $ make
  $ make deploy
  ...
  File: "/home/hebasto/GitHub/build/../bitcoin/release/bitcoin-qt.exe" -> no files found.
  Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
     /oname=outfile one_file_only)
  Error in script "<stdin>" on line 75 -- aborting creation process
  error: could not build bitcoin-22.99.0-win64-setup.exe
  built bitcoin-22.99.0-win64-setup.exe
  ```

  This PR fixes this bug.

ACKs for top commit:
  laanwj:
    Code review ACK a5f67b4ca8

Tree-SHA512: 7ac2f15cdc433fe509f2392d08a3c611b190a11ff92f718902cf9e25cfb9515f3840f4ddf2b1bfb8a1090e85773e671405c838cbe2b970205a12c20ebaf645bd
2022-02-12 13:09:45 +00:00
fanquake
3bb9394070
Merge bitcoin/bitcoin#23998: build: support OpenBSD in depends
471d15536f build: add support for OpenBSD to depends (fanquake)
75ae39eeec build: add a default build tar in depends (fanquake)

Pull request description:

  Completes the BSD trifecta. No Qt. Includes a commit that adds a default build_TAR to depends, to make it easier to override and use gnu/gtar, as OpenBSDs tar does not support some of the options we use. Also includes this patch, 684f067dde, to fix a compilation issue in Boost test.

  Have tested on OpenBSD 7.0 with:
  ```bash
  gmake -C depends -j9
  ./autogen.sh
  CONFIG_SITE=/home/vagrant/bitcoin/depends/amd64-unknown-openbsd7.0/share/config.site ./configure --disable-external-signer MAKE=gmake
  gmake check -j9
  ```

ACKs for top commit:
  laanwj:
    Tested ACK 471d15536f
  theStack:
    Tested ACK 471d15536f

Tree-SHA512: 7009b5d4c84355ebe4ece7042e0ce131659b97eace611fb77f1f16901aafb4b28118961a608a245289772ef7c4acb606dc18357a82c91cdceaf6466fc1cfd242
2022-02-11 21:18:53 +00:00
Andrew Chow
2d7ea201fc
Merge bitcoin/bitcoin#24307: RPC: Return external_signer in getwalletinfo
b75f4c89ec RPC: Return external_signer in getwalletinfo (Kristaps Kaupe)

Pull request description:

  Add `external_signer` to the result object of `getwalletinfo` RPC which indicates whether `WALLET_FLAG_EXTERNAL_SIGNER` flag is set for the wallet.

ACKs for top commit:
  S3RK:
    utACK b75f4c89ec
  achow101:
    ACK b75f4c89ec
  prayank23:
    utACK b75f4c89ec
  brunoerg:
    utACK b75f4c89ec

Tree-SHA512: 066ccb97541fd4dc3d9728834645db714a3c8c93ccf29142811af4d79cfb9440a97bbb6c845434a909bc6e1775ef3737fcbb368c1f0582bc63973f6deb17a45f
2022-02-11 12:20:22 -05:00
MarcoFalke
fa6065661a
refactor: Avoid unsigned integer overflow in core_write 2022-02-11 17:21:44 +01:00
MarcoFalke
b79c40b057
Merge bitcoin/bitcoin#24308: util: use stronger-guarantee rename method
ee822d85d6 util: use stronger-guarantee rename method (Vasil Dimov)

Pull request description:

  Use std::filesystem::rename() instead of std::rename(). We rely on the
  destination to be overwritten if it exists, but std::rename()'s behavior
  is implementation-defined in this case.

  This is a rebase of #20435 by vasild.

ACKs for top commit:
  MarcoFalke:
    review ACK ee822d85d6
  hebasto:
    Approach ACK ee822d85d6.
  vasild:
    ACK ee822d85d6

Tree-SHA512: 8f65f154d235c2704f18008d9d40ced3c5d84e4d55653aa70bde345066b6083c84667b5a2f4d69eeaad0bec6c607645e21ddd2bf85617bdec4a2e33752e2059a
2022-02-11 16:41:25 +01:00
Vasil Dimov
36ee76d1af
net: remove unused CNetAddr::GetHash() 2022-02-11 15:21:52 +01:00
Vasil Dimov
d0abce9a50
net: include the port when deciding a relay destination
In `PeerManagerImpl::RelayAddress()` we used just the hash of the
address that is being relayed to decide where to relay it to. Include
the port in that hash, so that e.g. `1.1.1.1:5555` and `1.1.1.1:6666`
get relayed to different peers. Those are two different, distinct
services after all.
2022-02-11 15:21:51 +01:00
Vasil Dimov
2e38a0e686
net: add CServiceHash constructor so the caller can provide the salts
This new constructor will be useful if we just want to hash a `CService`
object without the two `GetRand()` calls (in `RelayAddress()` in a
subsequent commit).
2022-02-11 15:21:50 +01:00
Vasil Dimov
97208634b9
net: open p2p connections to nodes that listen on non-default ports
By default, for mainnet, the p2p listening port is 8333. Bitcoin Core
has a strong preference for only connecting to nodes that listen on that
port.

Remove that preference because connections over clearnet that involve
port 8333 make it easy to detect, analyze, block or divert Bitcoin p2p
traffic before the connection is even established (at TCP SYN time).

For further justification see the OP of:
https://github.com/bitcoin/bitcoin/pull/23306
2022-02-11 15:21:49 +01:00
MarcoFalke
bcecde64b4
Merge bitcoin/bitcoin#24316: ci: Rename Cirrus CI osx_instance to macos_instance
c49e7db8ae ci: Follow Cirrus CI docs (Hennadii Stepanov)

Pull request description:

  See https://github.com/cirruslabs/cirrus-ci-docs/pull/763.

ACKs for top commit:
  katesalazar:
    ACK c49e7db8ae

Tree-SHA512: b86d571258e2682113833d575ca36a60b108ee38f2d74846b7631a29b9578cad00a29e62a3a1d808b21d2de3a27230f9ac58814c9f9b02d08675e65170ccd7e5
2022-02-11 13:21:01 +01:00
Hennadii Stepanov
c49e7db8ae
ci: Follow Cirrus CI docs
See https://github.com/cirruslabs/cirrus-ci-docs/pull/763
2022-02-11 13:52:22 +02:00
fanquake
5f7f2f7ffa
Merge bitcoin/bitcoin#24241: doc: cleanup doc on need of Developer Account to obtain macOS SDK
ddcac22f09 doc: cleanup doc on need of Developer Account to obtain macOS SDK (jarolrod)

Pull request description:

  The explicit statement that an Apple Developer Account is required in order to obtain the SDK is buried within the `Deterministic macOS DMG Notes` section. It should be the first thing mentioned under the `SDK Extraction` section.
  The reason to do this is to set expectations of what is required before starting any steps or clicking on links.

  This fixes the issue by doing just that; moving this information to the `SDK Extraction` section. Now that the information is moved, this also deletes unnecessary SDK related notes from the `Deterministic macOS DMG Notes` section. It is not necessary to explain under what sub-directory 'most' of the important files are inside of the `Xcode.app`.

  Note that this also fixes a missed Xcode version link bump by deleting it :)

ACKs for top commit:
  fanquake:
    ACK ddcac22f09

Tree-SHA512: 9fe7fddd66b68a0475be8b0c78cb58932bf5b68d962ece36a86f3b743a88d8561c0ec3e8d88bcaf338da7ab9d3dfcfb9399f6e1a884d83c8f3117c186d049469
2022-02-11 08:39:54 +00:00
jarolrod
ddcac22f09 doc: cleanup doc on need of Developer Account to obtain macOS SDK
The explicit statement that an Apple Developer Account is required in
order to obtain the SDK is buried within the "Deterministic macOS DMG
Notes" section. It should be the first thing mentioned under the "SDK
Extraction" section. The reason to do this is to set expectations of
what is required before starting any steps or clicking on links.

This fixes the issue by doing just that; moving this information to the
"SDK Extraction" section. Now that the information is moved, this also
deletes unnecessary SDK related notes from the "Deterministic macOS DMG
Notes" section. It is not necessary to explain under what sub-directory
'most' of the important files are inside of the 'Xcode.app'.
2022-02-10 23:50:16 -05:00
fanquake
471d15536f
build: add support for OpenBSD to depends 2022-02-10 12:33:10 +00:00
fanquake
75ae39eeec
build: add a default build tar in depends
This is so we can override it later for BSDs.
2022-02-10 12:33:02 +00:00
laanwj
a7e80449c0
Merge bitcoin/bitcoin#24238: random: use arc4random on OpenBSD
0c49e52b22 build: remove unneeded getentropy detection (HAVE_GETENTROPY) (Sebastian Falbesoner)
5cd15ffdce random: use arc4random on OpenBSD (Sebastian Falbesoner)

Pull request description:

  Inspired by a discussion on obtaining randomness on various OSes in a secp256k1 PR (https://github.com/bitcoin-core/secp256k1/pull/748#discussion_r524605472, see also https://bitcoincore.reviews/libsecp256k1-748), I think it makes sense to follow best practices and use `arc4random_buf` rather than `getentropy` on OpenBSD in our random module.

  The [getentropy(2) man page](https://man.openbsd.org/getentropy.2) states:
  ```
  getentropy() is not intended for regular code; please use the
  arc4random(3) family of functions instead.
  ```

  The [arc4random(3) man page](https://man.openbsd.org/arc4random.3) states:

  ```
  Use of these functions is encouraged for almost all random number
  consumption because the other interfaces are deficient in either quality,
  portability, standardization, or availability.
  ```
  On the linked PR discussion worries about using RC4 internally has been expressed (see https://security.stackexchange.com/questions/85601/is-arc4random-secure-enough/172905#172905), but this would only affect users of OpenBSD <5.5, using a version that was released more than 8 years ago.

ACKs for top commit:
  laanwj:
    Tested ACK 0c49e52b22

Tree-SHA512: b5ed3d0718962c5a3839db9a28f93d08a0ac93094cc664f83bc4cf1cfad25049e6240b7b81fe06b71e6a3a0ca24a2c337eab088abec5470ad014e10c04fdb216
2022-02-10 10:00:51 +01:00
Pieter Wuille
34d0e07e92
Test that OP_1-OP_16 (but not lower/higher) start witness programs 2022-02-10 08:51:48 +00:00
Vasil Dimov
ee822d85d6
util: use stronger-guarantee rename method
Use std::filesystem::rename() instead of std::rename(). We rely on the
destination to be overwritten if it exists, but std::rename()'s behavior
is implementation-defined in this case.
2022-02-10 08:16:05 +00:00
fanquake
243a9c3925
Merge bitcoin/bitcoin#24297: Fix unintended unsigned integer overflow in strencodings
fac9fe5d05 Fix unintended unsigned integer overflow in strencodings (MarcoFalke)

Pull request description:

  This fixes two issues for strings that start with a colon and only have one colon:

  * `fMultiColon` is incorrectly set to `true`
  * There is an unsigned integer overflow `colon - 1` (`0 - 1`)

  Neither issue matters, as the result is discarded. Though, it makes sense to still fix the issue for clarity and to avoid sanitizer issues in the function.

ACKs for top commit:
  laanwj:
    Code review ACK fac9fe5d05
  shaavan:
    Code Review ACK fac9fe5d05

Tree-SHA512: e71c21a0b617abf241e561ce6b90b963e2d5e2f77bd9547ce47209a1a94b454384391f86ef5d35fedd4f4df19add3896bb3d61fed396ebba8e864e3eeb75ed59
2022-02-10 07:17:32 +00:00
fanquake
8796c2f568
Merge bitcoin/bitcoin#24302: test: Remove unused integer sanitizer suppressions
fa2807ef19 test: Remove unused integer sanitizer suppressions (MarcoFalke)

Pull request description:

  Looks like they are not needed anymore. Maybe due to commit 7de2cf9b25 ?

ACKs for top commit:
  fanquake:
    ACK fa2807ef19

Tree-SHA512: 300aa47bd2cf6d44ad0d1d78889afeeb9ed0d7080f330e912db4c295dd13c43aaccdfbd4d7251006d2c0b848af6fb0d52104142ff528564edac8af49318f9f50
2022-02-10 07:15:37 +00:00
fanquake
3dc0bb9552
Merge bitcoin/bitcoin#24298: fuzz: Avoid unsigned integer overflow in FormatParagraph
fa2f7d0059 fuzz: Avoid unsigned integer overflow in FormatParagraph (MarcoFalke)

Pull request description:

  `FormatParagraph` is only ever called with compile time constant arguments, so I don't see the need for fuzzing it.

  Though, keep it for now, but avoid the unsigned integer overflow with this patch.

ACKs for top commit:
  laanwj:
    Code review ACK fa2f7d0059

Tree-SHA512: 01fc64a9ef73c183921ca1b0cd8db9514c0a242e3acf215a3393f383ae129e01625ebb16eaf9cb86370eda62d0145c3dcf8f62e40edf5958abc1f777c5687280
2022-02-10 07:14:24 +00:00
Kristaps Kaupe
b75f4c89ec
RPC: Return external_signer in getwalletinfo 2022-02-10 03:23:47 +02:00
brunoerg
7abd8b21ba doc: include wtxid in TransactionDescriptionString 2022-02-09 21:15:24 -03:00
brunoerg
2d596bce6f doc: add wtxid info in release-notes 2022-02-09 21:15:19 -03:00
fanquake
8c0f02c69d
Merge bitcoin/bitcoin#24265: Drop StripRedundantLastElementsOfPath() function
ebda2b8c81 util: Drop no longer needed StripRedundantLastElementsOfPath() function (Hennadii Stepanov)
ecd094e2b1 Use ArgsManager::GetPathArg() for "-walletdir" option (Hennadii Stepanov)
06fed4c21e Use ArgsManager::GetPathArg() for "-blocksdir" option (Hennadii Stepanov)
15b632bf16 Use ArgsManager::GetPathArg() for "-datadir" option (Hennadii Stepanov)
540ca5111f util: Add ArgsManager::GetPathArg() function (Hennadii Stepanov)

Pull request description:

  [Switching](https://github.com/bitcoin/bitcoin/pull/20744) to `std::filesystems` makes possible to leverage [`std::filesystem::path::lexically_normal`](https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal) and get rid of ugly `StripRedundantLastElementsOfPath()` crutch.

  To make its usage simple and error-proof, a new `ArgsManager::GetPathArg()` member function introduced which guarantees to return a normalized with no trailing slashes paths provided via `-datadir`, `-blocksdir` or `-walletdir` command-line arguments or configure options.

ACKs for top commit:
  ryanofsky:
    Code review ACK ebda2b8c81. Only change since last review is rebase which simplified the last commit

Tree-SHA512: ed86959b6038b7152b5a1d473478667b72caab1716cc9149e1a75833d50511f22157e4e5e55a9465d1fa76b90bce5e5286f4e4f0d1ae65ebd9c012fae19d835f
2022-02-09 21:41:36 +00:00
MarcoFalke
fa2807ef19
test: Remove unused integer sanitizer suppressions 2022-02-09 21:26:25 +01:00
Jon Atack
f485a07454
Add missing thread safety lock assertions in validation.h 2022-02-09 19:13:50 +01:00
Jon Atack
37af8a20cf
Add missing thread safety lock assertions in validation.cpp
Co-authored-by: Shashwat <svangani239@gmail.com>
2022-02-09 19:13:49 +01:00
Hennadii Stepanov
ebda2b8c81
util: Drop no longer needed StripRedundantLastElementsOfPath() function 2022-02-09 19:33:24 +02:00
Hennadii Stepanov
ecd094e2b1
Use ArgsManager::GetPathArg() for "-walletdir" option 2022-02-09 19:31:23 +02:00
Hennadii Stepanov
06fed4c21e
Use ArgsManager::GetPathArg() for "-blocksdir" option 2022-02-09 19:31:23 +02:00
Hennadii Stepanov
15b632bf16
Use ArgsManager::GetPathArg() for "-datadir" option 2022-02-09 19:31:22 +02:00
Hennadii Stepanov
540ca5111f
util: Add ArgsManager::GetPathArg() function
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2022-02-09 19:31:16 +02:00
Jon Atack
ae9ceed3e2
validation, refactoring: remove ChainstateManager::Reset()
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>
2022-02-09 18:04:54 +01:00
MarcoFalke
fa1b89a6bd
scripted-diff: Rename nReadPos to m_read_pos in streams.h
-BEGIN VERIFY SCRIPT-
 sed -i 's/nReadPos/m_read_pos/g' ./src/streams.h
-END VERIFY SCRIPT-
2022-02-09 17:21:04 +01:00
MarcoFalke
fa56c79df9
Make CDataStream work properly on 64-bit systems 2022-02-09 17:21:01 +01:00