Commit Graph

30511 Commits

Author SHA1 Message Date
Amiti Uttarwar
7dc443a62d [addrman] Change addrman #define constants to be constexprs
Co-authored-by: John Newbery <john@johnnewbery.com>
2021-08-26 11:56:13 -07:00
John Newbery
a65053f1d4 [addrman] Move CAddrMan::Unserialize to cpp file
Reviewer hint: use `git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space`

Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
2021-08-26 11:53:44 -07:00
John Newbery
1622543cf4 [addrman] Move CAddrMan::Serialize to cpp file
Reviewer hint: use `git diff --color-moved=dimmed-zebra
--color-moved-ws=ignore-all-space`

Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
2021-08-26 11:53:34 -07:00
Shashwat
ab1461d5d3 qt: Add copy IP/Netmask action for banned peer
This adds a copy IP/Netmask context menu action for peers in the banned peer table
2021-08-26 23:33:27 +05:30
Hennadii Stepanov
92ddc02a16
qt, refactor: Declare getWalletModel with const and noexcept qualifiers 2021-08-26 16:28:00 +03:00
Hennadii Stepanov
ca0e680bdc
qt, refactor: Drop redundant checks of walletModel
The walletModel member is set in the WalletView constructor now.
2021-08-26 16:28:00 +03:00
Hennadii Stepanov
404373bc6a
qt, refactor: Pass WalletModel object to WalletView constructor
An instance of the WalletView class without walletModel data member
being set is invalid. So, it is better to set it in the constructor.
2021-08-26 16:27:56 +03:00
Hennadii Stepanov
774a4f517c
Merge bitcoin-core/gui#403: refactor: Make paths to update Encryption and HD wallet statuses simpler
b8aa84b1a1 qt, refactor: Replace `if` check with `assert` (Hennadii Stepanov)
fcdc8b0fcb qt, refactor: Drop redundant signalling in WalletView::setWalletModel (Hennadii Stepanov)
37dcf161d3 qt, refactor: Emit WalletView::encryptionStatusChanged signal directly (Hennadii Stepanov)
7d0d4c0490 qt: Add WalletFrame::currentWalletSet signal (Hennadii Stepanov)

Pull request description:

  This PR makes signal-slot paths to reach `setHDStatus` and `setEncryptionStatus` functions shorter and easier to reason about them.

  Required to simplify #398 (see https://github.com/bitcoin-core/gui/pull/398#discussion_r686094883).

  ---

  **Note for reviewers.** Please verify that "Encrypt Wallet..." menu item, and the following icons

  ![DeepinScreenshot_select-area_20210811202120](https://user-images.githubusercontent.com/32963518/129074601-13fa998a-ac47-4ad2-be00-ba400b12c18a.png)

  and updated properly in each and every possible scenario.

ACKs for top commit:
  jarolrod:
    tACK b8aa84b1a1
  Talkless:
    Code review ACK b8aa84b1a1. Did build on Debian Sid with Qt 5.15.2 but no actual testing performed.
  ryanofsky:
    Code review ACK b8aa84b1a1. Only change since last review was rebase

Tree-SHA512: 275737cdba02baff71049df41bc24089e916f96326dd2dea26ec607c7949cb3aae368eeabbe3ad5a0a27651503a1d65536873726de854c5f6af259bcc29727e7
2021-08-26 15:56:18 +03:00
W. J. van der Laan
7740ebcb02
Merge bitcoin/bitcoin#22648: doc, test: improve i2p/tor docs and i2p reachable unit tests
017597767b Add I2P network SetReachable/IsReachable unit test assertions (Jon Atack)
b87a9c4d13 Improve doc/i2p.md regarding I2P router options/versions (Jon Atack)
bebcf785c0 Update i2p.md and tor.md regarding -onlynet config option (Jon Atack)

Pull request description:

  This pull addresses https://github.com/bitcoin/bitcoin/issues/22634#issuecomment-894104681 and various user feedback/questions, updates the -onlynet documentation in doc/i2p.md and doc/tor.md per #22651 (src/init.cpp is already fine) and fills in some missing I2P unit test coverage.

  Note: this PR depends in part on whether #22651 is merged in order to propose the correct -onlynet documentation (it is currently aligned with the change in #22651), so that PR should be decided or merged first.

ACKs for top commit:
  Rspigler:
    Re-ACK 017597767b
  prayank23:
    reACK 017597767b
  vasild:
    ACK 017597767b

Tree-SHA512: ae606437522bfccdfb7508108cddc7dfede2385e30a0561dbd007b784ed2639962c28552eb0e9336412faa323637fe964c26b8d8fc6dcf9fc63734ac00d05736
2021-08-26 12:44:46 +02:00
MarcoFalke
fa001602cd
ci: Re-enable verify-commits.py check 2021-08-26 11:17:59 +02:00
MarcoFalke
fa880b10d6
ci: Unconditionally set the global git author name in cirrys.yml
The author is also needed for the verify-commits.py script.
2021-08-26 11:17:07 +02:00
MarcoFalke
0492b56e38
Merge bitcoin/bitcoin#22738: test: fix failure in feature_nulldummy.py on single-core machines
7720d4f650 test: fix failure in feature_nulldummy.py on single-core machines (Sebastian Falbesoner)
646b3885f7 test: refactor: use named args for block_submit in feature_nulldummy.py (Sebastian Falbesoner)

Pull request description:

  On single-core machines, executing the test `feature_nulldummy.py` results in the following assertion error:

  ```
      ...
      2021-08-18T15:37:58.805000Z TestFramework (INFO): Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation
      2021-08-18T15:37:58.814000Z TestFramework (ERROR): Assertion failed
      Traceback (most recent call last):
        File "[...]/test/functional/test_framework/test_framework.py", line 131, in main
          self.run_test()
        File "[...]/test/functional/feature_nulldummy.py", line 107, in run_test
          self.block_submit(self.nodes[0], [test4tx], accept=False)
        File "[...]/test/functional/feature_nulldummy.py", line 134, in block_submit
          assert_equal(None if accept else 'block-validation-failed', node.submitblock(block.serialize().hex()))
        File "[...]/test/functional/test_framework/util.py", line 49, in assert_equal
          raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
      AssertionError: not(block-validation-failed == non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero))
      2021-08-18T15:37:58.866000Z TestFramework (INFO): Stopping nodes
      ...
  ```

  There are hardly any single-core machines around anymore, but the behaviour can be reproduced on a multi-core machine by patching the function `GetNumCores()` to return 1 on the master branch and running `feature_nulldummy.py`:

  ```diff
  diff --git a/src/util/system.cpp b/src/util/system.cpp
  index 30d410381..149b512fc 100644
  --- a/src/util/system.cpp
  +++ b/src/util/system.cpp
  @@ -1338,7 +1338,7 @@ bool SetupNetworking()

   int GetNumCores()
   {
  -    return std:🧵:hardware_concurrency();
  +    return 1;
   }
  ```
  As solution, parallel script verification is disabled (`-par=1`) and the exact reject reason is checked, which also increases the precision of the test (the possibility that the block is rejected because of another unintended reason is ruled out). See also related PR #22711 which applies the same approach for the p2p segwit test. The PR also includes a refactoring commit which changes the calls to `self.block_submit()` to use named arguments and removes the default value for parameter `accept` (i.e. explicitely passing `accept=...` is mandatory), with the aim to increase the test readability.

ACKs for top commit:
  josibake:
    ACK 7720d4f650
  Saviour1001:
    Tested ACK <code>[7720d4f](7720d4f650)</code>

Tree-SHA512: 8a31ebab3e2ab38e555d7a23139b3324a134a0dedc5b879a2419348ae858323882dbbfcbbf88b68e4f8d7eea8cfe43ee19da1d0d2a36c93ae7878c4980cac31d
2021-08-26 11:12:03 +02:00
MarcoFalke
faf7e485e9
Set regtest.BIP65Height = 111 to speed up tests 2021-08-26 11:08:24 +02:00
MarcoFalke
fa9eade142
Remove GetAddrName
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#c131-avoid-trivial-getters-and-setters
2021-08-26 10:44:26 +02:00
MarcoFalke
fa786570a5
Remove unused RecursiveMutex cs_addrName 2021-08-26 10:27:52 +02:00
fanquake
3a62b8b77e
Merge bitcoin/bitcoin#22713: Fix build with Boost 1.77.0
acb7aad27e Fix build with Boost 1.77.0 (Rafael Sadowski)

Pull request description:

  BOOST_FILESYSTEM_C_STR changed to accept the path as an argument.

ACKs for top commit:
  hebasto:
    ACK acb7aad27e
  benthecarman:
    ACK acb7aad27e
  fanquake:
    ACK acb7aad27e - tested the fix with Boost 1.77.0 and 1.71.0.

Tree-SHA512: c25fcb56971ee7a448cfb074f8a13696b32c16c63f81076f8a76911f93aa849c8f3637555b0b4215fa0d8b958641d7e4e60d10e103b833545cbc6b1f4009b526
2021-08-26 16:20:52 +08:00
MarcoFalke
718d9f2f77
Merge bitcoin/bitcoin#22660: contrib: catch bitcoin-cli RPC call errors in getcoins.py
42dbd9025a contrib: return non-zero status if getcoins.py errors (Sebastian Falbesoner)
8c203cf0e1 contrib: catch bitcoin-cli RPC call errors in getcoins.py (Sebastian Falbesoner)
0eca5ebace contrib: refactor: introduce bitcoin-cli RPC call helper in getcoins.py (Sebastian Falbesoner)

Pull request description:

  This PR is based on #22565 ("[script] signet's getcoins.py improvements"), which should be reviewed first.

  The signet faucet script `contrib/signet/getcoins.py` currently issues bitcoin-cli RPC calls without catching errors -- the only case tackled is if there is no `bitcoin-cli` file found. Instead of crashing with a stack-trace on a failed RPC call, the changes in this PR aim to produce a more user-friendly output (see also https://github.com/bitcoin/bitcoin/pull/22565#discussion_r683754875). Additionally, in case of any error, a non-zero status is now returned (instead of 0, indicating success), which could be useful for other scripts taking use of signet faucet script.

  The most straight-forward way to test this is invoking the script without a `bitcoind` running on signet:

  PR22565 branch:
  ```
  $ ./contrib/signet/getcoins.py
  error: Could not connect to the server 127.0.0.1:8332

  Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
  Traceback (most recent call last):
    File "./contrib/signet/getcoins.py", line 26, in <module>
      curr_signet_hash = subprocess.check_output([args.cmd] + args.bitcoin_cli_args + ['getblockhash', '1']).strip().decode()
    File "/usr/local/lib/python3.8/subprocess.py", line 415, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['bitcoin-cli', 'getblockhash', '1']' returned non-zero exit status 1.
  ```

  this PR branch:
  ```
  $ ./contrib/signet/getcoins.py
  error: Could not connect to the server 127.0.0.1:38332

  Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
  -----
  Error while calling "bitcoin-cli -signet getblockhash 1" (see output above).
  ```

ACKs for top commit:
  kallewoof:
    Code ACK 42dbd9025a
  Zero-1729:
    tACK 42dbd90 🧪

Tree-SHA512: 912240a4ed03c87035e370602f4095c7ffe26806421bbbd6cf86588126f2310a01a6a61606e9e2918fb2c1a0debdd0ce768c69ba2e4b8e7750fa3474a56d01a0
2021-08-26 10:04:57 +02:00
MarcoFalke
cea38b491f
Merge bitcoin/bitcoin#22183: Remove gArgs from wallet.h and wallet.cpp
c3c213215b Use `context.args` in `src/wallet/load.cpp`. (Kiminuo)
25de4e77fe Use `context.args` in `CWallet::Create` instead of `gArgs`. (Kiminuo)
aa5e7c9471 Fix typo in bitcoin-cli.cpp (Kiminuo)

Pull request description:

  The PR attempts to move us an inch towards the [goal](https://github.com/bitcoin/bitcoin/pull/21244#discussion_r615307465) by using `WalletContext` in `wallet.{h|cpp}` code instead of relying on the global state (i.e. `gArgs`).

  Edit: The PR builds on #19101.

ACKs for top commit:
  ryanofsky:
    Code review ACK c3c213215b. Changes since last review: just rebasing and adding wallet load commit

Tree-SHA512: 2b436f5a219e32c2d529f55a89edca086d949396cebf9e089a21aa7b1c180e3c0fb17468f415dfc834f8e1614f8b3914c7e9a0bd33b95e7e0199c0dfe5ca9490
2021-08-26 10:01:43 +02:00
MarcoFalke
84be9a89c1
Merge bitcoin/bitcoin#22755: fuzz: Avoid timeout in blockfilter fuzz target
fa2547fc52 fuzz: Avoid timeout in blockfilter fuzz target (MarcoFalke)

Pull request description:

  Previously it would take 10 seconds to run this input, now it takes 10ms: [clusterfuzz-testcase-blockfilter-5022838196142080.log](https://github.com/bitcoin/bitcoin/files/7021883/clusterfuzz-testcase-blockfilter-5022838196142080.log)

  The fix is moving the `MatchAny` out of the hot loop.

  Also, to avoid unlimited runtime, cap the hot loop at 30k iterations.

ACKs for top commit:
  GeneFerneau:
    Approach ACK [fa2547f](fa2547fc52)

Tree-SHA512: a04e7388856930ec81222da8f05b665a923fe9482aeb4c55c9be4561aa7320a0703dbbf8d438ae92854e877a8e3b46777a29c0b652b8f34c29c2142cc5d63ccb
2021-08-26 08:10:12 +02:00
fanquake
f046131481
Merge bitcoin/bitcoin#22797: test, doc: refer to the correct variable names in p2p_invalid_tx.py
0d9fdd329e test, doc: refer to the correct variable names in p2p_invalid_tx.py (aitorjs)

Pull request description:

  _tx_orphan_no_fee_ and _tx_orphan_invalid_ don't exist as transactions.

  Have been replaced by _tx_orphan_2_no_fee_ and _tx_orphan_2_invalid_ respectively.

  **Motivation**: Comments are more accurate and easy understandable under the tests context (I think).

ACKs for top commit:
  kristapsk:
    utACK 0d9fdd329e
  theStack:
    ACK 0d9fdd329e 📃

Tree-SHA512: a4cafd931e51fe2a67085e10e9c61178c864c14982664d112b76327e040af08cd1de04eca4a8ae980fad57ba7078017ce02fc60e7658f38380e8172c2ae28b77
2021-08-26 09:03:59 +08:00
aitorjs
0d9fdd329e test, doc: refer to the correct variable names in p2p_invalid_tx.py 2021-08-25 22:55:10 +02:00
MarcoFalke
e08770bed1
Merge bitcoin/bitcoin#22780: doc: Remove incorrect INIT_PROTO_VERSION from nTime comment
fa9c075f72 doc: Remove incorrect INIT_PROTO_VERSION from nTime comment (MarcoFalke)

Pull request description:

  Missed in commit dbcb5742c4

ACKs for top commit:
  sipa:
    ACK fa9c075f72
  jnewbery:
    ACK fa9c075f72

Tree-SHA512: d086b94658219fadca1a937e64ef5b6a475fbf72661b6008d98e0e2b912cbbdb1f025c531b12a8ed9946fbbd79e1e09fba7c91403fc997158e1170dfbd300b29
2021-08-25 20:13:22 +02:00
Kiminuo
c3c213215b Use context.args in src/wallet/load.cpp. 2021-08-25 16:08:51 +02:00
John Newbery
593247872d [net] Remove CConnMan::SetAsmap()
CAddrMan::m_asmap is now set directly in AppInitMain() so
CConnMan::SetAsmap() is no longer required.
2021-08-25 13:23:53 +01:00
John Newbery
50fd77045e [init] Read/decode asmap before constructing addrman
Commit 181a1207 introduced an initialization order bug: CAddrMan's
m_asmap must be set before deserializing peers.dat. Restore that
ordering.

review hint: use

`git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
2021-08-25 13:23:50 +01:00
MarcoFalke
fa82f4ea96
Remove unused MaybeSetAddrName
This logic is a no-op since it was introduced in commit
f9f5cfc506.

m_addr_name is never initialized to the empty string, because
ToStringIPPort never returns an empty string.
2021-08-24 19:19:19 +02:00
glozow
f293c68be0 MOVEONLY: getting mempool conflicts to policy/rbf 2021-08-24 15:51:54 +01:00
glozow
8d71796335 [validation] quit RBF logic earlier and separate loops
No behavior change.
While we're looking through the descendants and calculating how many
transactions we might replace, quit early, as soon as we hit 100.
Since we're failing faster, we can also separate the loops - yes, we
loop through more times, but this helps us detangle the different BIP125
rules later.
2021-08-24 15:47:21 +01:00
glozow
badb9b11a6 call SignalsOptInRBF instead of checking all inputs 2021-08-24 15:47:21 +01:00
glozow
e0df41d7d5 [validation] default conflicting fees and size to 0
This should have no effect in practice, since we only ever call
PreChecks once per transaction.
2021-08-24 15:47:21 +01:00
glozow
b001b9f6de MOVEONLY: BIP125 max conflicts limit to policy/rbf.h
A circular dependency is added because policy now depends on txmempool and
txmempool depends on validation. It is natural for [mempool] policy to
rely on mempool; the problem is caused by txmempool depending on
validation. #22677 will resolve this.
2021-08-24 15:47:21 +01:00
Rafael Sadowski
acb7aad27e Fix build with Boost 1.77.0
BOOST_FILESYSTEM_C_STR changed to accept the path as an argument
2021-08-24 12:49:02 +02:00
fanquake
eb09c26724
Merge bitcoin/bitcoin#22741: test: Add generate* calls to test framework
fab2e23b57 Use generate* from TestFramework (MarcoFalke)
faf7e92804 test: Add generate* calls to test framework (MarcoFalke)

Pull request description:

  This is needed for #22567.

  By making the calls to `generate*` member function of the test framework, it paves the way to make it easier to implicitly call the `sync_all` member function.

ACKs for top commit:
  jnewbery:
    utACK fab2e23b57

Tree-SHA512: 7a7be6be71f0602119689df45d63a1adec309f323eac2330ee0f200676001afe825605859bd02c6a8a8dcf85d925dc1bc37370ef1ceb8ad1d85a66eec0dbfff9
2021-08-24 16:22:30 +08:00
MarcoFalke
dd455ecfa0
Merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch
3ae503c95b refactor: replace QDateTime::toTime_t with QDateTime::toSecsSinceEpoch (fanquake)
27257b39bf refactor: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch (fanquake)

Pull request description:

  `QDateTime::fromTime_t` has [been obsoleted](https://doc.qt.io/qt-5.12/qdatetime-obsolete.html#fromTime_t) in favour of [`QDateTime::fromSecsSinceEpoch`](https://doc.qt.io/qt-5.12/qdatetime.html#fromSecsSinceEpoch), which is available from Qt 5.8+.

ACKs for top commit:
  hebasto:
    ACK 3ae503c95b

Tree-SHA512: 774243bccb4c4bd9e8ceeee0450d4f57b5665bdef8bcec0538d29664922fd354189d48718ca62ca49048b8b90c9b31ed184e1eefd7ff4529c55ba7d2b079e51e
2021-08-24 10:09:53 +02:00
fanquake
3ae503c95b
refactor: replace QDateTime::toTime_t with QDateTime::toSecsSinceEpoch 2021-08-24 15:08:04 +08:00
fanquake
27257b39bf
refactor: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2021-08-24 15:06:46 +08:00
Kiminuo
25de4e77fe Use context.args in CWallet::Create instead of gArgs. 2021-08-24 07:46:52 +02:00
Kiminuo
aa5e7c9471 Fix typo in bitcoin-cli.cpp 2021-08-24 07:44:09 +02:00
fanquake
b20ad0eb16
Merge bitcoin/bitcoin#22772: refactor: hasher cleanup (follow-up to 19935)
4c69571e6e doc: remove outdated comment (Martin Zumsande)
16652a93ea refactor: Remove unused KeyIDHasher (Martin Zumsande)

Pull request description:

  Small follow-ups to  #19935:

  - Removal of unused `KeyIDHasher`  class ([comment in 19935](https://github.com/bitcoin/bitcoin/pull/19935#discussion_r544464524))
  - Removal of an outdated comment, which referred to an old problem with the no longer supported Boost 1.46 and `boost::unordered_map`, now replaced by `std::unordered_map`. ([comment in 19935](https://github.com/bitcoin/bitcoin/pull/19935#discussion_r540911134))

ACKs for top commit:
  Saviour1001:
    Tested ACK <code>[4c69571](4c69571e6e)</code>
  Zero-1729:
    ACK 4c69571e6e
  theStack:
    ACK 4c69571e6e 🆗

Tree-SHA512: 243fda2120bfac6c40a268ca2c0f34482ce27e71fbc50005c0d13c2ad5db9ee72a037f9937c37cc50ed0f9f6f11ee6afee4ac50e5031d6876ec942f41f38dadf
2021-08-24 11:12:15 +08:00
fanquake
61a843e43b
Merge bitcoin/bitcoin#22220: util: make ParseMoney return a std::optional<CAmount>
f7752adba5 util: check MoneyRange() inside ParseMoney() (fanquake)
5ef2738089 util: make ParseMoney return a std::optional<CAmount> (fanquake)

Pull request description:

  Related discussion in #22193.

ACKs for top commit:
  MarcoFalke:
    review ACK f7752adba5 📄

Tree-SHA512: 88453f9e28f668deff4290d4bc0b2468cbd54699a3be1bfeac63a512276d309354672e7ea7deefa01466c3d9d826e837cc1ea244d4d74b4fa9c11c56f074e098
2021-08-24 10:43:38 +08:00
Andrew Chow
d9d3ec07cf Consolidate XOnlyPubKey lookup hack
The places where we need to lookup information for a XOnlyPubKey
currently implement a hack which makes both serializations of the full
pubkey in order to try the CKeyIDs for the lookup functions. Instead of
duplicating this everywhere it is needed, we can consolidate the CKeyID
generation into a function, and then have wrappers around GetPubKey,
GetKey, and GetKeyOrigin which takes the XOnlyPubKey, retrieves all of
the CKeyIDs (using the new GetKeyIDs() function in XOnlyPubKey), and
tries their respective underlying lookup function.
2021-08-23 21:38:34 -04:00
Hennadii Stepanov
d3203a99d8
Merge bitcoin-core/gui#408: Add missing mnemonics in menu bar options
7c33e3a572 qt: Add missing mnemonics in menu bar options (Shashwat)

Pull request description:

  Since #362 we have defaulted to add mnemonic shortcuts for the context menus.
  The Window -> Minimize option and File -> Load PSBT from clipboard were hitherto missing a mnemonic shortcut. This PR adds mnemonic shortcuts for them

  Changes introduced in this PR:
  | Master | PR |
  | ----------| ---- |
  | ![Screenshot from 2021-08-23 23-10-07](https://user-images.githubusercontent.com/85434418/130494098-c65ec9da-c3f1-4243-9b3d-0c87cb677825.png) | ![Screenshot from 2021-08-23 23-08-41](https://user-images.githubusercontent.com/85434418/130494083-849ffd14-05e9-4a6d-bdc3-b3e55b8a8861.png)|
  |![Screenshot from 2021-08-23 23-10-21](https://user-images.githubusercontent.com/85434418/130494233-1b2e8838-c5d4-48a8-9abf-a4acc8d6146c.png)|![Screenshot from 2021-08-23 23-09-00](https://user-images.githubusercontent.com/85434418/130494181-dcdbf119-a2c6-469d-a6c9-3021506ab40b.png)|

ACKs for top commit:
  jarolrod:
    tACK 7c33e3a572
  hebasto:
    ACK 7c33e3a572, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 32f201ae7716b19ca123856292f8bfa0d805f6c7271ac1b5e08eff6b95017443754c8a76e8396ccca1869a57384e11016cbd99d63ccdd2fae6da4eaf3ae32298
2021-08-23 22:15:29 +03:00
MarcoFalke
ec6db8e858
Merge bitcoin/bitcoin#22769: fuzz: Use LIMITED_WHILE instead of limit_max_ops
faa5fa9a78 fuzz: Use LIMITED_WHILE instead of limit_max_ops (MarcoFalke)

Pull request description:

  This avoids the local stack variable `limit_max_ops` and makes it easier to grep for limited loops. Also, it is less code.

ACKs for top commit:
  theStack:
    Code-review ACK faa5fa9a78 🍷
  Zero-1729:
    crACK faa5fa9a78 🥤

Tree-SHA512: b10d89f4ce57bac0d6e9de9db7d4db85bae81bc02536d46a910be8c0e77333f2d9a547c7fe03df57f5ff9fd90b6994b09996d8e148573fb7ecd840d08b5c0c7d
2021-08-23 20:57:07 +02:00
Shashwat
7c33e3a572 qt: Add missing mnemonics in menu bar options
The Window -> Minimize an File -> Load PSBT from clipboard options were missing a mnemonic
shortcut. This PR adds mnemonic shortcuts for them.
2021-08-23 23:06:55 +05:30
W. J. van der Laan
b1c4a4ed39
Merge bitcoin-core/gui#406: Handle new added plurals in bitcoin_en.ts
2b3d8f3dde qt: Handle new added plurals in bitcoin_en.ts (Hennadii Stepanov)

Pull request description:

  This step was missed. See [`translation_process.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md#handling-plurals-in-source-files).

  Transifex is smart enough to handle `%n` in strings as a plural form. Therefore, only two English strings are broken in the GUI on master (and in 22.0).

ACKs for top commit:
  laanwj:
    ACK 2b3d8f3dde

Tree-SHA512: d39c0da8a295fd7a42e7f2ca3cf5b4f7704c2bdeccdeb10392b37e06dc8577295c9fefbdd5442824639f31c3d014b025a9b937f0b3f630a8ebc977451a5f14f5
2021-08-23 19:27:27 +02:00
W. J. van der Laan
1bbe289f20
Merge bitcoin/bitcoin#22565: [script] signet's getcoins.py improvements
b0c8246cac Add cleaner errors for unsuccessful faucet transactions (NikhilBartwal)
1c612b274b [script] Update signet getcoins.py for custom network (NikhilBartwal)

Pull request description:

  Currently, using the getcoins.py with a custom signet executes successfully and shows the transfer of 0.001 testBTC as complete, however for obvious reasons, it should not. In fact, upon verification it does not actually execute the transaction, but rather gives the output that it did, as shown below which can be misleading:

  ```
  [nikhilb@nikhil-PC bitcoin]$ echo $datadir
  /home/nikhilb/signet-custom
  [nikhilb@nikhil-PC bitcoin]$ contrib/signet/getcoins.py -- -datadir=$datadir
  Payment of 0.00100000 BTC sent with txid dd22c7d996e95f3e5baf20f73140d517ff48f1b26d0e4fefd61e3c37991b8f86
  [nikhilb@nikhil-PC bitcoin]$ bitcoin-cli -datadir=$datadir getrawtransaction dd22c7d996e95f3e5baf20f73140d517ff48f1b26d0e4fefd61e3c37991b8f86
  error code: -5
  error message:
  No such mempool or blockchain transaction. Use gettransaction for wallet transactions.
  [nikhilb@nikhil-PC bitcoin]$ bitcoin-cli -datadir=$datadir gettransaction dd22c7d996e95f3e5baf20f73140d517ff48f1b26d0e4fefd61e3c37991b8f86
  error code: -5
  error message:
  Invalid or non-wallet transaction id

  ```
  This PR adds a sanity check for custom signet by comparing the current network's first block hash (the block after the genesis block) with global signet's respective block hash (since all signet networks share the same genesis block) and if a custom network is detected, the user is prompted to either work on the global signet or setup their own faucet.

  The PR was checked to be working successfully, giving the output as below:

  ```
  [nikhilb@nikhil-PC bitcoin]$ git checkout update_signet_getcoins
  Switched to branch 'update_signet_getcoins'
  Your branch is ahead of 'upstream/master' by 1 commit.
    (use "git push" to publish your local commits)
  [nikhilb@nikhil-PC bitcoin]$ contrib/signet/getcoins.py -- -datadir=$datadir
  The global faucet cannot be used with a custom Signet network. Please use the global signet or setup your custom faucet for the same.

  You can have a look here for setting up your own faucet: https://en.bitcoin.it/wiki/Signet

  ```

ACKs for top commit:
  prayank23:
    utACK b0c8246cac
  kallewoof:
    ACK b0c8246cac
  arnabsen1729:
    utACK b0c8246
  prakash1512:
    utACK b0c8246
  0xB10C:
    Tested ACK b0c8246cac
  theStack:
    Tested ACK b0c8246cac
  Zero-1729:
    crACK b0c8246 🧉

Tree-SHA512: 144b47a83008521a5cda13f4c1b12809a125a744f865a8e0f792132d52fdb88926d4f4f4d7230452c2e129b5879892cdbeda981b8af10b789e9fc0cda2905a5d
2021-08-23 19:19:00 +02:00
MarcoFalke
fa9c075f72
doc: Remove incorrect INIT_PROTO_VERSION from nTime comment 2021-08-23 18:53:34 +02:00
MarcoFalke
dbcb5742c4
Merge bitcoin/bitcoin#20541: Move special CAddress-without-nTime logic to net_processing
75290ae61e Drop us=... message in net debug for sending version message (Pieter Wuille)
5d47860334 refactor: move CAddress-without-nTime logic to net_processing (Pieter Wuille)

Pull request description:

  Historically, the VERSION message contains an "addrMe" and an "addrYou". As these are sent before version negotiation is complete, the protocol version is INIT_PROTO_VERSION (209), and in that protocol, CAddress is serialized without nTime.

  This is in fact the only situation left where a CAddress is (de)serialized without nTime. As it's such a simple structure (CService for ip/port + uint64_t for nServices), just inline that structure in the few places where it occurs, and remove the logic for dealing with missing nTime from CAddress.

ACKs for top commit:
  Zero-1729:
    crACK 75290ae61e
  jonatack:
    ACK 75290ae61e
  vasild:
    ACK 75290ae61e

Tree-SHA512: ccd9f478e1766fb2ad845d512b090e6297b82100640545ca490d930785801da3b429d40400bc2eb2cbe9057d5d12362ab33f8d650a1ca9e9e85857aef36ec414
2021-08-23 18:19:52 +02:00
Sebastian Falbesoner
7720d4f650 test: fix failure in feature_nulldummy.py on single-core machines
On single-core machines, executing the test feature_nulldummy.py results in
the following assertion error:

...
2021-08-18T15:37:58.805000Z TestFramework (INFO): Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation
2021-08-18T15:37:58.814000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "[...]/test/functional/test_framework/test_framework.py", line 131, in main
    self.run_test()
  File "[...]/test/functional/feature_nulldummy.py", line 107, in run_test
    self.block_submit(self.nodes[0], [test4tx], accept=False)
  File "[...]/test/functional/feature_nulldummy.py", line 134, in block_submit
    assert_equal(None if accept else 'block-validation-failed', node.submitblock(block.serialize().hex()))
  File "[...]/test/functional/test_framework/util.py", line 49, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(block-validation-failed == non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero))
2021-08-18T15:37:58.866000Z TestFramework (INFO): Stopping nodes
...

The behaviour can be reproduced on a multi-core machine by simply changing the
function GetNumCores() (in src/util/system.cpp) to return 1:

int GetNumCores()
{
    return 1;
}
2021-08-23 18:11:37 +02:00
Sebastian Falbesoner
646b3885f7 test: refactor: use named args for block_submit in feature_nulldummy.py 2021-08-23 18:11:37 +02:00