Commit Graph

27433 Commits

Author SHA1 Message Date
Carl Dong
e4b95eefbc validation: Move GetSpendHeight to BlockManager
[META] This commit should be followed up by removing the comments and
       assertions meant only to show that the change is correct.

GetSpendHeight only acts on BlockManager.
2021-01-28 14:15:26 -05:00
Carl Dong
b026e318c3 validation: Move FindForkInGlobalIndex to BlockManager
[META] This commit should be followed up by removing the comments and
       assertions meant only to show that the change is correct.

FindForkInGlobalIndex only acts on BlockManager.

Note to reviewers: Since FindForkInGlobalIndex is always called with
::ChainActive() as its first parameter, it is possible to move
FindForkInGlobalIndex to CChainState and remove this const CChain&
parameter to instead use m_chain. However, it seems like the original
intention was for FindForkInGlobalIndex to work with _any_ chain, not
just the current active chain. Let me know if this should be changed.
2021-01-28 14:15:26 -05:00
Carl Dong
3664a150ac validation: Remove global LookupBlockIndex 2021-01-28 14:15:26 -05:00
Carl Dong
eae54e6e60 scripted-diff: Use BlockManager::LookupBlockIndex
[META] In a previous commit, we moved ::LookupBlockIndex to become a
       member function of BlockManager. This commit is split out from
       that one since it can be expressed nicely as a scripted-diff.

-BEGIN VERIFY SCRIPT-
find_regex='LookupBlockIndex' \
    && git grep -l -E "$find_regex" -- src \
        | grep -v '^src/validation\.\(cpp\|h\)$' \
        | xargs sed -i -E "s@${find_regex}@g_chainman.m_blockman.LookupBlockIndex@g"
-END VERIFY SCRIPT-
2021-01-28 14:15:26 -05:00
Carl Dong
15d20f40e1 validation: Move LookupBlockIndex to BlockManager
[META] This commit should be followed up by a scripted-diff commit which
       fixes calls to LookupBlockIndex tree-wide.
[META] This commit should be followed up by removing the comments and
       assertions meant only to show that the change is correct.

LookupBlockIndex only acts on BlockManager.
2021-01-28 14:15:26 -05:00
Carl Dong
f92dc6557a validation: Guard the active_chainstate with cs_main
This avoids a potential race-condition where a thread is reading the
ChainstateManager::m_active_chainstate pointer while another one is
writing to it. There is no portable guarantee that reading/writing the
pointer is thread-safe.

This is also done in way that mimics ::ChainstateActive(), so the
transition from that function to this method is easy.

More discussion:
1. https://github.com/bitcoin/bitcoin/pull/20749#discussion_r559544027
2. https://github.com/bitcoin/bitcoin/pull/19806#discussion_r561023961
3. https://github.com/bitcoin/bitcoin/pull/19806#issuecomment-768946522
4. https://github.com/bitcoin/bitcoin/pull/19806#issuecomment-768955695
2021-01-28 14:14:22 -05:00
Jarol Rodriguez
5d1f260713 Improve gui/src/qt README.md
The current readme is a little bit outdated and contains some grammatical mistakes. This commit updates the doc so that:
  - It is easier to follow and is more informative
  - Fixes grammatical mistakes
  - Modernizes the Qt Creater setup instructions
  - Adds UNIX instructions for Qt Creator setup
2021-01-28 14:03:21 -05:00
Wladimir J. van der Laan
80e16cadd5
Merge #20012: rpc: Remove duplicate name and argNames from CRPCCommand
fa04f9b4dd rpc: Remove duplicate name and argNames from CRPCCommand (MarcoFalke)
fa92912b4b rpc: Use RPCHelpMan for check-rpc-mappings linter (MarcoFalke)
faf835680b rpc: [refactor] Use concise C++11 code in CRPCConvertTable constructor (MarcoFalke)

Pull request description:

  Currently, the RPC argument names are specified twice to simplify consistency linting. To avoid having to specify the argnames twice when adding new arguments, remove the linter and add an equivalent test based on RPCHelpMan.

ACKs for top commit:
  laanwj:
    ACK fa04f9b4dd

Tree-SHA512: 3f5f32f5a09b22d879f24aa67031639d2612cff481d6aebc6cfe6fd757cafb3e7bf72120b30466f59292a260747b71e57322c189d5478b668519b9f32fcde31a
2021-01-28 19:25:12 +01:00
MarcoFalke
6ba2ffd28b
Merge #21004: contrib: Fix docker args conditional in gitian-build
624091b7b9 Fix docker args conditional (setpill)

Pull request description:

  The conditional that checks if docker needs to be installed has the side effect of triggering the default `lxc` branch in case docker comes preinstalled. This is clearly not intentional.

ACKs for top commit:
  laanwj:
    Code review ACK 624091b7b9
  theStack:
    Code review ACK 624091b7b9

Tree-SHA512: e37e2c35aaed813762223e5963e5416d5865b3fb53efb2aac86daaa03b95ccf07db9c3a779446029d055ab89491147c4d900117273e22caed201b21bdf287c58
2021-01-28 17:42:59 +01:00
MarcoFalke
4d5eaf7a90
Merge #20995: fuzz: Avoid initializing version to less than MIN_PEER_PROTO_VERSION
fad3d7625a fuzz: Avoid initializing version to less than MIN_PEER_PROTO_VERSION (MarcoFalke)
fa99e33aeb fuzz: move-only FillNode implementation to cpp file (MarcoFalke)

Pull request description:

  This fixes a fuzz bug introduced in #20881. Previously the nodes in the fuzz tests had their version initialized to a constant (`PROTOCOL_VERSION`). After #20881, the nodes have their version initialized to an arbitrary signed integer. This is problematic for several reasons:

  * Both `nVersion` and `m_greatest_common_version` may be initialized to `0`. If a `version` message is processed, this leads to a crash, because `m_greatest_common_version` must be `INIT_PROTO_VERSION` while the `version` message is processed. See #20138
  * The "valid" range for `nVersion` is `[MIN_PEER_PROTO_VERSION, std::numeric_limits<int32_t>::max()]` (see check in net_processing)
  * The "valid" range for `m_greatest_common_version` is `std::min(nVersion, PROTOCOL_VERSION)` (see net_processing)

  Fix all issues by initializing `nVersion` and `m_greatest_common_version` to their valid ranges.

  -----

  The crashers, if someone wants to try this at home:

  ```
  ( echo 'dmVyc2lvbgAWFhYWFhYWFhYWFhYWFhYWFhYWFhZp/29uAPX//xYWFhYWFhYWFhYWFhYWFhYWFhYW
  FhYWFhYWaW9uAOr1//8WFhYWFha0ZXJzaW9uAPX//wAAAAAAABAAAAAAAAAAAAC0ZXJzaW9uAPX/
  /wBPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT08AAAAAABAAAAAAAAAAAAAAAAAA
  AAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  AAAAAAAAAAAAAAB2ZXJzaW9uAACDJIO9vXYKAAAAAAAAAAAAAAAAAAAAAAB2ZfS1qmu1qhUVFWs=' | base64 --decode > /tmp/a ) && FUZZ=process_message_version ./src/test/fuzz/fuzz /tmp/a
  ```
  ```
  ( echo 'dmVyc2lvbgD//wAhTmiqN///NDcAAACENDL/iv//8DYAAHL///////79/RtcAJqamhqa/QEAAAD/
  ///+/f1oZWFkZXJzAAAAAM8BAAAAIAYibkYRGgtZyq8SaGVhZGVycwAAAAD/NDcAAACENDL/iv//
  8DYAAHL///////79/RtcAJqamhqa/QEAAAD////+/f1oZWFkZXJzAAAAAM8BAAAAIAYibkYRGgtZ
  yq8SaGVhZGVycwAAAADPAQAAACAGIm5GERoLWS1wb3J061u/KMNPOkwFXqZ///b5IgIAAD+5ubkb
  XD5hZGRyAJqamhqasP0BAAAAAAAAAP0BAAAAIf39/R0dHQAAAAAAMgAA///7//+gXqZ///b5IgIA
  AD+5ubm5ubm5AAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAFgAAAAAAAAAAAAlBmv39/f1/f39B
  f39hZGRyAG5vAACaLgAdGzY2zwEAAAAgBiJuRhEaC1ktcG9ydOtbvyjDTzpMBV6mf//2+SICAAA/
  ubm5G1w+YWRkcgCampoamrD9AQAAAAAAAAD9AQAAACH9/f0dHR0AAAAAADIAAP//+///oF6mf//2
  +SICAAA/ubm5ubm5uQAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAABYAAAAAAAAAAAAJQZr9/f39
  f39/QX9/YWRkcgBubwAAmi4AHRs2NjY2NjY2NjYCAgI2NgIA/f39/f39Nv39/TUmABxc' | base64 --decode > /tmp/b ) && FUZZ=process_message_version ./src/test/fuzz/fuzz /tmp/b
  ```

ACKs for top commit:
  practicalswift:
    cr ACK fad3d7625a

Tree-SHA512: ea64ee99b94d8e619e3949d2d21252c1236412c0e40f44f2b73595ca70cd2da0bdab005fb1a54f65fb291e7b07fdd33577ce4a3a078ca933246b511ebcb0e52a
2021-01-28 15:13:25 +01:00
Jonas Schnelli
68692d33c6
Merge bitcoin-core/gui#85: Remove unused "What's This" button in dialogs on Windows OS
ac7ccd67d7 scripted-diff: Remove unused "What's This" button in dialogs on Windows (Hennadii Stepanov)
b6951483ec qt: Add flags to prevent a "What's This" button on Windows OS (Hennadii Stepanov)

Pull request description:

  Fix #74.

  From [Qt docs](https://doc.qt.io/qt-5/qdialog.html#QDialog):
  > The widget flags _f_ are passed on to the `QWidget` constructor. If, for example, you don't want a **What's This** button in the title bar of the dialog, pass `Qt::WindowTitleHint | Qt::WindowSystemMenuHint` in _f_.

  Screenshot on Windows 10 (2004):
  - master (3ba25e3bdd)
  ![Screenshot from 2020-09-07 16-55-42](https://user-images.githubusercontent.com/32963518/92402384-20dc6a00-f138-11ea-9dcb-3e0f6373ff22.png)

  - this PR (e322fe7e19ac504272d14b9b4f9b28b13df888ed)
  ![Screenshot from 2020-09-07 18-31-16](https://user-images.githubusercontent.com/32963518/92402509-5aad7080-f138-11ea-8b63-9bbbf8b9b9e1.png)

ACKs for top commit:
  Bosch-0:
    tACK ac7ccd67d7 Tested on Windows 10.0.18363 Build 18363.
  promag:
    Code review ACK ac7ccd67d7 but with some suggestions.
  jonasschnelli:
    utACK ac7ccd67d7

Tree-SHA512: f6750a17b7203106cb4db5870becba1cef6a505d4edcc710ba131338bd3aae051510627e62c9bcb8345a7f497c614709e11aeb8f6ae3ea85967bbce2a8c69e64
2021-01-28 10:16:55 +01:00
Jonas Schnelli
7595183543
Merge bitcoin-core/gui#72: util: Log static plugins meta data and used style
957895c715 util: Log static plugins meta data and style (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up of https://github.com/bitcoin/bitcoin/pull/17826, and adds additional info about the imported static plugins and the used style to the `debug.log` I found useful for testing (e.g., with `QT_QPA_PLATFORM`, `QT_QPA_PLATFORMTHEME`, `QT_STYLE_OVERRIDE` variables) and debugging issues (e.g., https://github.com/bitcoin/bitcoin/pull/19716#issuecomment-674052881).

  The excerpt from the log:
  ```
  2020-11-15T18:41:45Z [main] Bitcoin Core version v0.20.99.0-f0b933f78 (release build)
  2020-11-15T18:41:45Z [main] Qt 5.9.8 (static), plugin=xcb (static)
  2020-11-15T18:41:45Z [main] Static plugins:
  2020-11-15T18:41:45Z [main]  QXcbIntegrationPlugin, version 329992
  2020-11-15T18:41:45Z [main] Style: fusion / QFusionStyle
  ...
  ```

ACKs for top commit:
  jarolrod:
    ACK 957895c715, Tested on macOS 11.1
  jonasschnelli:
    utACK 957895c715

Tree-SHA512: 0e46db7560f380fbda8ce5e53faa5d419a456e90ca595ce46be8e3030c99d3a113586edad1988a97e9bf0279e944f975968ed1156817bc16723ed31c64850239
2021-01-28 10:14:32 +01:00
Jonas Schnelli
02b01651c5
Merge bitcoin-core/gui#177: Use "fusion" style on macOS Big Sur with old Qt
4e1154dfd1 qt: Use "fusion" style on macOS Big Sur with old Qt (Hennadii Stepanov)

Pull request description:

  The "macintosh" style is broken on macOS Big Sur:

  - https://github.com/bitcoin/bitcoin/issues/20555#issuecomment-756264648
  - #136

ACKs for top commit:
  MarcoFalke:
    review ACK 4e1154dfd1 can't test
  jarolrod:
    ACK 4e1154dfd1
  jonasschnelli:
    Tested ACK 4e1154dfd1

Tree-SHA512: c2e0f7be220c8b34b182c73e362f41d0e8c8c002e766fcb5491c62f3cfb9f70eabbd32b29baefa152135efc5f83b15534c1c2459e500a586b0f64c5aa8acf614
2021-01-28 10:07:33 +01:00
MarcoFalke
fa04f9b4dd
rpc: Remove duplicate name and argNames from CRPCCommand 2021-01-28 08:19:52 +01:00
MarcoFalke
fa92912b4b
rpc: Use RPCHelpMan for check-rpc-mappings linter 2021-01-28 08:16:34 +01:00
MarcoFalke
faf835680b
rpc: [refactor] Use concise C++11 code in CRPCConvertTable constructor 2021-01-28 08:16:31 +01:00
Anthony Towns
48c8a9b964 net_processing: log txrelay flag from version message 2021-01-28 16:04:04 +10:00
Anthony Towns
98fab37ca0 net: use peer=N instead of from=N in debug log 2021-01-28 16:04:04 +10:00
Anthony Towns
12302105bb net_processing: additional debug logging for ignored messages 2021-01-28 16:04:04 +10:00
Anthony Towns
f7edea3b7c net: make debug logging conditional on -debug=net 2021-01-28 16:04:04 +10:00
Anthony Towns
a410ae8cb0 net, net_processing: log disconnect reasons with -debug=net 2021-01-28 16:04:04 +10:00
Samuel Dobson
9deba2de76
Merge #20226: wallet, rpc: add listdescriptors command
647b81b709 wallet, rpc: add listdescriptors command (Ivan Metlushko)

Pull request description:

  Looking for concept ACKs

  **Rationale**: allow users to inspect the contents of their newly created descriptor wallets.

  Currently the command only returns xpubs which is not very useful in itself, but there are multiples ways to extend it:
   * add an option to export xprv
   * with #19136 it'll be possible to return normalised descriptors suitable for a watch-only purposes

  The output is compatible with `importdescriptors` command so it could be easily used for backup/recover purposes.

  **Output example:**
  ```json
  [
    {
      "desc": "wpkh(tpubD6NzVbkrYhZ4WW6E2ZETFyNfq2hfF23SKxqSGFvUpPAY58jmmuBybwqwFihAyQPk9KnwTt5516NDZRJ7k5QPeKjy7wuVd5WvXNxwwAs5tUD/*)#nhavpr5h",
      "timestamp": 1296688602,
      "active": false,
      "range": [
        0,
        999
      ],
      "next": 0
    }
  ]
  ```

ACKs for top commit:
  jonatack:
    re-ACK 647b81b709 rebased to master, debug builds cleanly, reviewed diff since last review, tested with a descriptor wallet (and with a legacy wallet)
  achow101:
    re-ACK 647b81b

Tree-SHA512: 51a3620bb17c836c52cecb066d4fa9d5ff418af56809046eaee0528c4dc240a4e90fff5711ba96e399c6664e00b9ee8194e33852b1b9e75af18061296e19a8a7
2021-01-28 13:40:18 +13:00
Ivan Metlushko
647b81b709 wallet, rpc: add listdescriptors command 2021-01-27 21:22:13 +01:00
Wladimir J. van der Laan
d1ddead09a
Merge #180: Peer details: connection type follow-ups
79a2576af1 doc: update ConnectionType Doxygen documentation (Jon Atack)
f3153dc08f gui: improve markup handling of connection type tooltip (Jon Atack)
4f09615733 gui: return inbound {full, block} relay type in peer details (Jon Atack)

Pull request description:

  Three follow-ups to #163:
  - return relay type for inbound peers
  - improve markup handling in the tooltip to facilitate translations
  - update ConnectionType doxygen documentation

  ![Screenshot from 2021-01-11 08-37-44](https://user-images.githubusercontent.com/2415484/104156081-50e69300-53e0-11eb-9b0f-880cb5626d68.png)

ACKs for top commit:
  hebasto:
    re-ACK 79a2576af1, only suggested changes since my [previous](https://github.com/bitcoin-core/gui/pull/180#pullrequestreview-564894781) review.
  jarolrod:
    ACK 79a2576af1, tested on macOS 11.1 with Qt 5.15.2
  laanwj:
    Code review ACK 79a2576af1

Tree-SHA512: 4a8d8f8bfbaefd68e8d1bf3b20d29e4a8e8cfe97b2f8d59d3a4c338a50b61de0a67d97bd8646c04bd5df5a9679c4954b9b46e7cba24bb89f4d0e44e94cf9d66c
2021-01-27 20:33:52 +01:00
Wladimir J. van der Laan
15a9df0706
Merge #20964: rpc: Add specific error code for "wallet already loaded"
a6739cc868 rpc: Add specific error code for "wallet already loaded" (Wladimir J. van der Laan)

Pull request description:

  Add a separate RPC error code for "wallet already loaded" to avoid having to match on message to detect this.
  Requested by shesek for rust-bitcoinrpc.

  If concept ACKed needs:
  - [ ]  Release note
  - [x]  A functional test (updated the existing test to make it pass, I think this is enough)

ACKs for top commit:
  jonasschnelli:
    Code Review ACK a6739cc868
  promag:
    Code review ACK a6739cc868.

Tree-SHA512: 9091872e6ea148aec733705d6af330f72a02f23b936b892ac28f9023da7430af6332418048adbee6014305b812316391812039e9180f7f3362d11f206c13b7d0
2021-01-27 13:43:31 +01:00
MarcoFalke
11d3b58336
Merge #20757: doc: tor.md and -onlynet help updates
193f9a9c97 doc: update tor.md manual config, move after automatic config (Jon Atack)
9af99b6f39 doc: update/improve automatic tor section of tor.md (Jon Atack)
dfc4ce1273 doc: update -proxy, -onion and -onlynet info in tor.md (saibato)
784a278e87 doc: update -onlynet help in src/init.cpp (Jon Atack)

Pull request description:

  This continues the tor documentation and help improvements of #19961 and clarifies issues that contributors have been mentioning and noticing, like in https://github.com/bitcoin/bitcoin/issues/20555#issuecomment-750433818.

  More info:

  - https://github.com/bitcoin/bitcoin/pull/19961#discussion_r545051534
  - https://github.com/bitcoin/bitcoin/pull/19961#discussion_r544912964

ACKs for top commit:
  Rspigler:
    ACK 193f9a9c97
  prayank23:
    ACK 193f9a9c97 9af99b6f39 dfc4ce1273

Tree-SHA512: edb1b776c4624e1c2e30d829511c226a6492b719f5d1aaaeee1eaade47c108a99c09004d13a05f70b2d65f36db3db647902b5ea36807a87065f34acade33ccea
2021-01-27 13:21:04 +01:00
Jon Atack
193f9a9c97
doc: update tor.md manual config, move after automatic config 2021-01-26 15:13:29 +01:00
MarcoFalke
faff3991a9
ci: Fuzz with integer sanitizer 2021-01-26 12:50:43 +01:00
MarcoFalke
e130ff38c9
Merge bitcoin-core/gui#183: Add include for std::bind.
2a39ccf133 Add include for std::bind. (sinetek)

Pull request description:

  Hi, this patch adds in <functional> because the GUI code makes use of std::bind.
  That's all.

ACKs for top commit:
  jonasschnelli:
    utACK 2a39ccf133

Tree-SHA512: fb5ac07d9cd5d006182b52857b289a9926362a2f1bfa4f7f1c78a088670e2ccf39ca28214781df82e8de3909fa3e69685fe1124a7e3ead758575839f5f2277a9
2021-01-26 11:14:27 +01:00
Jonas Schnelli
5f65f13597
Merge bitcoin-core/gui#189: qt: drop workaround for QTBUG-42503 which was fixed in Qt 5.5.0
a2a3f4cd8d qt: drop workaround for QTBUG-42503 which was fixed in Qt 5.5.0 (Pavol Rusnak)

Pull request description:

  Fixes https://github.com/bitcoin-core/gui/issues/101

ACKs for top commit:
  jonasschnelli:
    Tested ACK a2a3f4cd8d -

Tree-SHA512: 9ccbc20ff7991ec70cac7d4e4413f9d80a1de453e217d03927a5f167e87eae7f369f0ad437c40c8107e5384c5c5c758659ed0db923837a38f8d705f01f9cb798
2021-01-26 10:41:23 +01:00
Jonas Schnelli
d38e2d9a19
Merge bitcoin-core/gui#186: Add information to "Confirm fee bump" window
232d1f92bb Add information to "Confirm fee bump" window (Prayank)

Pull request description:

  + Add information in bump fee confirmation box according to the documentation: https://bitcoincore.org/en/doc/0.20.0/rpc/wallet/bumpfee/

  + Workaround to fix issue: https://github.com/bitcoin/bitcoin/issues/20795 in which user isn't aware of new inputs, outputs added to replacement transaction before broadcasting. Initial transaction had used coin control features and custom change address. Until the issue is fixed by change in coin selection algorithm we can add this warning.

  + Waiting for comments from devs who are working on coin selection algorithm PRs or involved in related research. However got two comments from Luke Dashjr and Pieter Wuille:

  _luke-jr: Reducing the change output also could be a privacy problem, since it identifies which output was change._

  _sipa: Wallet doesn't know the original transaction was using coin control. So I think its expected that if you use automatic fee bumping, you'll get whatever the coin selection algorithm decides. As for why its not decreasing the change and instead adding another input, that may be a bug._  (IRC: #bitcoin-core-dev)

ACKs for top commit:
  jonasschnelli:
    Tested ACK - 232d1f92bb

Tree-SHA512: 2ff65db1ddb1d4a45f82670b6ca303a0bf48acf3d09defffc21f44ec81cb6182268959706f592f3442aae5db48f43b8ea86973d74ec2721be93d209ce0414953
2021-01-26 10:30:13 +01:00
MarcoFalke
32d44d2b1c
Merge #21000: fuzz: Add UBSan suppressions needed for fuzz tests to not warn under -fsanitize=integer
f0f8b1a076 fuzz: Add UBSan suppressions needed for fuzz tests to not warn under -fsanitize=integer (practicalswift)
58232e3ffb fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses (practicalswift)

Pull request description:

  Add UBSan suppressions needed for fuzz tests to not warn under `-fsanitize=integer`.

  Avoid `-fsanitize=integer` warnings in fuzzing harnesses.

  Suppressed warnings (excluding warnings from `src/crypto/` and `src/test/`):

  ```
  addrman.cpp:306:24: runtime error: implicit conversion from type 'long' of value 5190149478 (64-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 895182182 (32-bit, unsigned)
  addrman.h:446:43: runtime error: implicit conversion from type 'int' of value -22 (32-bit, signed) to type 'const uint8_t' (aka 'const unsigned char') changed the value to 234 (8-bit, unsigned)
  arith_uint256.cpp:32:35: runtime error: left shift of 1712128 by 24 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  arith_uint256.cpp:47:39: runtime error: left shift of 4294966784 by 31 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  chain.cpp:151:12: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned long' changed the value to 18446744073709551615 (64-bit, unsigned)
  coins.cpp:114:22: runtime error: unsigned integer overflow: 0 - 96 cannot be represented in type 'unsigned long'
  compressor.cpp:162:33: runtime error: unsigned integer overflow: 15617702637291228364 * 10 cannot be represented in type 'unsigned long'
  compressor.cpp:188:11: runtime error: unsigned integer overflow: 2265760372865400000 * 10 cannot be represented in type 'unsigned long'
  hash.cpp:13:15: runtime error: left shift of 1692305888 by 15 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  pubkey.h:152:23: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'
  streams.h:570:31: runtime error: left shift of 350879 by 52 places cannot be represented in type 'uint64_t' (aka 'unsigned long')
  util/bip32.cpp:57:36: runtime error: left shift of 3241096244 by 1 places cannot be represented in type 'unsigned int'
  util/strencodings.cpp:562:38: runtime error: implicit conversion from type 'unsigned char' of value 255 (8-bit, unsigned) to type 'char' changed the value to -1 (8-bit, signed)
  util/strencodings.h:164:24: runtime error: implicit conversion from type 'int' of value -74 (32-bit, signed) to type 'unsigned long' changed the value to 18446744073709551542 (64-bit, unsigned)
  ```

  The warnings above happen here:

  32b191fb66/src/addrman.cpp (L306)
  32b191fb66/src/addrman.h (L446)
  32b191fb66/src/arith_uint256.cpp (L32)
  32b191fb66/src/arith_uint256.cpp (L47)
  32b191fb66/src/chain.cpp (L151)
  32b191fb66/src/coins.cpp (L114)
  32b191fb66/src/compressor.cpp (L162)
  32b191fb66/src/compressor.cpp (L188)
  32b191fb66/src/hash.cpp (L13)
  32b191fb66/src/pubkey.h (L152)
  32b191fb66/src/streams.h (L570)
  32b191fb66/src/util/bip32.cpp (L57)
  32b191fb66/src/util/strencodings.cpp (L562)
  32b191fb66/src/util/strencodings.h (L164)

ACKs for top commit:
  MarcoFalke:
    review ACK f0f8b1a076 🤚

Tree-SHA512: a8f04f7cc055d03653161de1d9d14d106a6280cea1e86a1243abcd57cf8e61dcf5f731d0ab0da5b390790e816022ff7a70759a641463bc7e3303076b8667009f
2021-01-26 10:00:43 +01:00
MarcoFalke
ce75fc36ed
Merge #20971: test: Work around libFuzzer deadlock
fa39c8a3e8 test: Work around libFuzzer deadlock (MarcoFalke)

Pull request description:

  Only required part is `symbolize=0`, but the other changes shouldn't hurt

ACKs for top commit:
  practicalswift:
    cr ACK fa39c8a3e8: patch looks correct

Tree-SHA512: 9cddf1de46ad12aea9b8be2c1acb86ba0e07ffdb52f8155d943edf970955551c7cb049a3a6c027846b45dab0dc0966dec42999476ebde50aa761a08dbb751eae
2021-01-26 09:56:24 +01:00
MarcoFalke
cbe439629e
Merge bitcoin-core/gui#167: raise helpMessageDialog
77114462f2 raise helpMessageDialog (randymcmillan)

Pull request description:

  the raise() method brings the helpMessageDialog to the top if it is obscured by another window.

ACKs for top commit:
  promag:
    Code review ACK 77114462f2.
  hebasto:
    ACK 77114462f2, tested on:

Tree-SHA512: 0d5b107aa9a5ce3891e88ef69f64461c8b23d17476b798691119e84bfc78e16b2491c798adb5d6cc347af3b7f18729593d7924090c336114a3cf34fbee344bfb
2021-01-26 09:47:52 +01:00
MarcoFalke
280d0bd0bd
Merge #21010: refactor: remove straggling boost::mutex usage
f827e151a2 refactor: remove straggling boost::mutex usage (fanquake)

Pull request description:

  After the merge of #18710, the linter is warning:
  ```bash
  A new Boost dependency in the form of "boost/thread/mutex.hpp" appears to have been introduced:
  src/sync.cpp:#include <boost/thread/mutex.hpp>
  src/test/sync_tests.cpp:#include <boost/thread/mutex.hpp>

  ^---- failure generated from test/lint/lint-includes.sh
  ```

  #18710 removed `boost/thread/mutex.hpp` from lint-includes, however in the interim #19337 was merged, which introduced more `boost::mutex` usage.

  Given we no longer use `boost::mutex`, just remove the double lock test and remaining includes.

ACKs for top commit:
  laanwj:
    Code review ACK f827e151a2
  hebasto:
    ACK f827e151a2

Tree-SHA512: f738b12189fe5b39db3e8f8231e9002714413a962eaf98adc84a6614fa474df5616358cfb1c89b92a2b0564efa9b704a774c49d4a25dca18a0ccc3cd9eabfc0a
2021-01-26 09:30:02 +01:00
Prayank
232d1f92bb Add information to "Confirm fee bump" window
Check if "Coin Control features" are enabled to display warning before broadcasting replacement transaction
Workaround to fix issue: bitcoin/bitcoin#20795

Co-authored-by: Jon Atack <jon@atack.com>
2021-01-26 13:51:21 +05:30
fanquake
f827e151a2
refactor: remove straggling boost::mutex usage
After the merge of #18710, the linter is warning:
```bash
A new Boost dependency in the form of "boost/thread/mutex.hpp" appears to have been introduced:
src/sync.cpp:#include <boost/thread/mutex.hpp>
src/test/sync_tests.cpp:#include <boost/thread/mutex.hpp>

^---- failure generated from test/lint/lint-includes.sh
```

the interim #19337 was merged, which introduced more `boost::mutex` usage.

Given we no longer use `boost::mutex`, just remove the double lock test
and remaining includes.
2021-01-26 15:57:28 +08:00
Samuel Dobson
16ae3368f2
Merge #17350: doc: Add developer documentation to isminetype
40f05647ee doc: Add developer documentation to isminetype (HAOYUatHZ)

Pull request description:

  Closes: https://github.com/bitcoin/bitcoin/issues/17217

ACKs for top commit:
  meshcollider:
    utACK 40f05647ee

Tree-SHA512: 156ff3bc02613d65aed5fcf50250ec3f3365b6c83c810763673ecfdd081a1310e5235be05f0c782638f191be61ad0028511392c40e4106a56eb1c6a3a8ab73b9
2021-01-26 13:24:35 +13:00
Samuel Dobson
4b15ffe991
Merge #20832: rpc: Better error messages for invalid addresses
8f0b64fb51 Better error messages for invalid addresses (Bezdrighin)

Pull request description:

  This PR addresses #20809.

  We add more detailed error messages in case an invalid address is provided inside the 'validateaddress' and 'getaddressinfo' RPC calls. This also covers the case when a user provides an address from a wrong network.

  We also add a functional test to test the new error messages.

ACKs for top commit:
  kristapsk:
    ACK 8f0b64fb51
  meshcollider:
    Code review ACK 8f0b64fb51

Tree-SHA512: ca0f806ab573e96b79e98d9f8c810b81fa99c638d9b5e4d99dc18c8bd2568e6a802ec305fdfb2983574a97a19a46fd53b77645f8078fb77e9deb24ad2a22cf93
2021-01-26 13:15:13 +13:00
practicalswift
f0f8b1a076 fuzz: Add UBSan suppressions needed for fuzz tests to not warn under -fsanitize=integer 2021-01-25 20:55:36 +00:00
practicalswift
58232e3ffb fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses 2021-01-25 20:55:36 +00:00
Jon Atack
9af99b6f39
doc: update/improve automatic tor section of tor.md 2021-01-25 21:31:10 +01:00
saibato
dfc4ce1273
doc: update -proxy, -onion and -onlynet info in tor.md
Improve the description of what these options do with regards to
tor or network traffic.

Some of the wording is from a laanwj review in PR 19358.
2021-01-25 21:31:08 +01:00
Jon Atack
784a278e87
doc: update -onlynet help in src/init.cpp 2021-01-25 21:31:05 +01:00
Wladimir J. van der Laan
52d84a45e2
Merge #20987: doc: add instructions for generating RPC docs
e147af7624 doc: add instructions for generating RPC docs (benk10)

Pull request description:

  Added instructions on how to generate the up to date RPC docs for the bitcoincore.org website in the relevant release-process subsection.

ACKs for top commit:
  theStack:
    ACK e147af7624 ⚙️

Tree-SHA512: 1621d9915ac77f663aa7892237d3e5ff4d9566301c4c0fcb8615804b68d71f6c19bd6e6d84710cd2d2ae492e6b149cdc6edae6292bd20d88d7ca8cd530b4081a
2021-01-25 20:33:23 +01:00
Wladimir J. van der Laan
b386d37360
Merge #18710: Add local thread pool to CCheckQueue
bb6fcc75d1 refactor: Drop boost::thread stuff in CCheckQueue (Hennadii Stepanov)
6784ac471b bench: Use CCheckQueue local thread pool (Hennadii Stepanov)
dba30695fc test: Use CCheckQueue local thread pool (Hennadii Stepanov)
01511776ac Add local thread pool to CCheckQueue (Hennadii Stepanov)
0ef938685b refactor: Use member initializers in CCheckQueue (Hennadii Stepanov)

Pull request description:

  This PR:
  - gets rid of `boost::thread_group` in the `CCheckQueue` class
  - allows thread safety annotation usage in the `CCheckQueue` class
  - is alternative to #14464 (https://github.com/bitcoin/bitcoin/pull/18710#issuecomment-616618525, https://github.com/bitcoin/bitcoin/pull/18710#issuecomment-617291612)

  Also, with this PR (I hope) it could be easier to resurrect a bunch of brilliant ideas from #9938.

  Related: #17307

ACKs for top commit:
  laanwj:
    Code review ACK bb6fcc75d1
  LarryRuane:
    ACK bb6fcc75d1
  jonatack:
    Code review ACK bb6fcc75d1 and verified rebase to master builds cleanly with unit/functional tests green

Tree-SHA512: fddeb720d5a391b48bb4c6fa58ed34ccc3f57862fdb8e641745c021841c8340e35c5126338271446cbd98f40bd5484f27926aa6c3e76fa478ba1efafe72e73c1
2021-01-25 20:21:19 +01:00
randymcmillan
77114462f2
raise helpMessageDialog 2021-01-25 10:57:44 -05:00
setpill
624091b7b9 Fix docker args conditional 2021-01-25 15:33:07 +01:00
MarcoFalke
d0852f39a7
Merge #20998: test: Fix BlockToJsonVerbose benchmark
7487bc9900 Fix BlockToJsonVerbose benchmark (Martin Ankerl)

Pull request description:

  Currently it was not possible to run just the BlockToJsonVerbose benchmark because it did not set up everything it needed, running `bench_bitcoin -filter=BlockToJsonVerbose` caused this assert to fail:

  ```
  bench_bitcoin: chainparams.cpp:506: const CChainParams& Params(): Assertion `globalChainParams' failed.
  ```

  Initializing TestingSetup fixes this.

ACKs for top commit:
  theStack:
    Tested ACK 7487bc9900 🐎

Tree-SHA512: 27b9702cb4bacc0475710f7b31f41844e83b8a0787685380749505d179aba724728604d4e4e2e3b3cb38cde88ab12f170881b5d3eb615872ee84632e85312166
2021-01-25 08:42:53 +01:00
Wladimir J. van der Laan
a6739cc868 rpc: Add specific error code for "wallet already loaded" 2021-01-25 07:55:35 +01:00