Commit Graph

28193 Commits

Author SHA1 Message Date
Hennadii Stepanov
0eabb2abed
build: Remove unused header from the build system 2021-03-22 19:10:49 +02:00
Wladimir J. van der Laan
c46f1ce751
Merge #21418: contrib: Make systemd invoke dependencies only when ready
663f6cd9dd contrib: Use -daemonwait in systemd init script (Wladimir J. van der Laan)

Pull request description:

  Make systemd invoke dependencies only when ready by using `-daemonwait` in the service file instead of `-daemon`.

  Closes #21322 by making bitcoind conform to behavior specified for `type=forking`.

  This may need some tuning of timeouts.

ACKs for top commit:
  darosior:
    ACK 663f6cd
  hebasto:
    re-ACK 663f6cd9dd

Tree-SHA512: 890005852b632a202caa578e6c796ebdc9da0b2379a9157a4f56f7db9d193c0ffbb78d120bbf112ab2f273855f2a08c3da000b1f7a9fb5222a3b94dcdb16b878
2021-03-22 15:15:14 +01:00
Wladimir J. van der Laan
663f6cd9dd contrib: Use -daemonwait in systemd init script
Closes #21322 by making bitcoind conform to behavior specified for
`type=forking`.
2021-03-22 13:42:13 +01:00
MarcoFalke
1e4a3c057a
Merge #21317: util: Make Assume() usable as unary expression
fa4cebadcf util: Make Assume() usable as unary expression (MarcoFalke)

Pull request description:

  Assume shouldn't behave different at the call site depending on build flags. Currently compilation fails if it is used as expression. Fix that by using the lambda approach from `Assert()` without the `assert()`.

ACKs for top commit:
  jnewbery:
    ACK fa4cebadcf
  practicalswift:
    cr ACK fa4cebadcf: patch looks correct and commit hash starts with `fa`

Tree-SHA512: 9ec9ac8d410cdaf5e4e28df571a89e3d23d38e05a7027bb726cae3da6e9314734277e5a218e9e090cc17e10db763da71052c229ad642077ca5824ee42022f3ed
2021-03-22 08:35:21 +01:00
MarcoFalke
786654aa5e
Merge #21498: refactor: return std::nullopt instead of {}
5294f0d5a9 refactor: return std::nullopt instead of {} (fanquake)

Pull request description:

  In #21415 [we decided](https://github.com/bitcoin/bitcoin/pull/21415#issuecomment-800236640) to return `std::optional` rather than `{}` for
  uninitialized values. This PR replaces the two remaining usages of `{}`
  with `std::nullopt`.

  As a side-effect, this also quells the spurious GCC 10.2.x warning that
  we've had reported quite a few times. i.e #21318, #21248, #20797.

  ```bash
  txmempool.cpp: In member function ‘CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<uint256>&) const’:
  txmempool.cpp:898:13: warning: ‘<anonymous>’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    898 |     return {};
        |             ^
  ```

ACKs for top commit:
  hebasto:
    ACK 5294f0d5a9, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 5b776be79ab26e5a3a5fc2b463b394ea5ce6797ed5558424873fa4ecee2898170eff76d6da9d69394d28f8f98974117fc63b922a3e19c52f5294c83073e79bb0
2021-03-22 06:42:04 +01:00
fanquake
80cb51cc6b
Merge #21491: test: remove duplicate assertions in util_tests
7e3444805e test: remove duplicate assertions in util_tests (Jon Atack)

Pull request description:

  as noticed by Kiminuo in https://github.com/bitcoin/bitcoin/pull/21488#discussion_r598247676

ACKs for top commit:
  practicalswift:
    cr ACK 7e3444805e: patch looks correct
  vasild:
    ACK 7e3444805e

Tree-SHA512: ad3d5983ad3a665155d766843dfda7178ced47e82154838331e428ed0828a467c1cf4bf99270aaf191e94156d485fafd0a7d5bc68248c4c1304a00ca5a2a9d2e
2021-03-22 11:43:35 +08:00
fanquake
5294f0d5a9
refactor: return std::nullopt instead of {}
In #21415 we decided to return `std::optional` rather than `{}` for
uninitialized values. This PR repalces the two remaining usages of `{}`
with `std::nullopt`.

As a side-effect, this also quells the spurious GCC 10.2.x warning that
we've had reported quite a few times. i.e #21318, #21248, #20797.

```bash
txmempool.cpp: In member function ‘CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<uint256>&) const’:
txmempool.cpp:898:13: warning: ‘<anonymous>’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  898 |     return {};
      |             ^
```
2021-03-22 11:22:06 +08:00
Jon Atack
7e3444805e
test: remove duplicate assertions in util_tests
Co-authored-by: Kiminuo <kiminuo@protonmail.com>
2021-03-21 11:14:35 +01:00
MarcoFalke
d2a78ee928
Merge #21488: test: add ParseUInt16() unit test and fuzz coverage
3d086f42ab test: add ParseUInt16() test coverage (Jon Atack)

Pull request description:

  `ParseUInt16()` was just added in #21328.

ACKs for top commit:
  practicalswift:
    cr ACK 3d086f42ab: patch looks correct & more coverage is better than less coverage

Tree-SHA512: bf7f96deb7c1531419565907f0ea8a8e32b368d4b823a3e80928b2c118edbf643ea06e357b4b5504a89f855caeed289daa9f823c740231ed6ad1b8ed00285ce8
2021-03-21 08:12:56 +01:00
MarcoFalke
9dbec05600
Merge #21349: build: Fix fuzz-cuckoocache cross-compiling with DEBUG=1
52a43b0c7d build: Fix fuzz-cuckoocache cross-compiling for Windows with DEBUG=1 (Hennadii Stepanov)

Pull request description:

  Fix #21348.

ACKs for top commit:
  practicalswift:
    Tested ACK 52a43b0c7d

Tree-SHA512: 6592f829edfb740a1e9d0691acf04b2372e91b0a53ca395b08350cb0b80031d3b55fa7331bdaddf857d450eb30b605af9fe8fe02559cda19374a48f9634fae70
2021-03-21 08:05:00 +01:00
MarcoFalke
4132193617
Merge #21040: wallet: Fix already-loading message grammar
ae9d26a8f0 wallet: Fix already-loading error message grammar (Fotis Koutoupas)

Pull request description:

ACKs for top commit:
  practicalswift:
    cr ACK ae9d26a8f0
  prayank23:
    ACK ae9d26a8f0

Tree-SHA512: 2f58d309dd33954f47e3ed339887b11bfdad4519f89ed3dd9bf3fb0db246d78b89653d553d02350ec84ce68bbb904db9fac00a2aad8d37f48df694d6782f35df
2021-03-21 07:51:11 +01:00
MarcoFalke
63952f73b3
Merge #20921: validation: don't try to invalidate genesis block in CChainState::InvalidateBlock
787df19b09 validation: don't try to invalidate genesis block (Sebastian Falbesoner)

Pull request description:

  In the block invalidation method (`CChainState::InvalidateBlock`), the code for creating the candidate block map assumes that the passed block's previous block (`pindex->pprev`) is available and otherwise segfaults due to null-pointer deference in `CBlockIndexWorkComparator()` (see analysis by practicalswift in #20914), i.e. it doesn't work with the genesis block. Rather than analyzing all possible code paths and implications for this corner case, simply fail early if the genesis block is passed.

  Fixes #20914.

ACKs for top commit:
  sipa:
    ACK 787df19b09. Tested invalidation of generic on regtest.
  practicalswift:
    Tested ACK 787df19b09

Tree-SHA512: 978be7cf2bd1c1faebfe945d191ac77dea72791bea826459abd308f77c74c5991efee495a38817c306e488ecd5208b5c888df7d9d044132dd9a06bbbdb256b6c
2021-03-20 12:46:11 +01:00
Jon Atack
3d086f42ab
test: add ParseUInt16() test coverage 2021-03-19 23:50:36 +01:00
MarcoFalke
3530d5d2d8
Merge #18335: bitcoin-cli: print useful error if bitcoind rpc work queue exceeded
8dd5946c0b add functional test (Larry Ruane)
b5a80fa7e4 util: Handle HTTP_SERVICE_UNAVAILABLE in bitcoin-cli (Hennadii Stepanov)

Pull request description:

  If `bitcoind` is processing 16 RPC requests, attempting to submit another request using `bitcoin-cli` produces this less-than-helpful error message: `error: couldn't parse reply from server`. This PR changes the error to: `error: server response: Work queue depth exceeded`.

ACKs for top commit:
  fjahr:
    tACK 8dd5946c0b
  luke-jr:
    utACK 8dd5946c0b (no changes since previous utACK)
  hebasto:
    re-ACK 8dd5946c0b, only suggested changes since my [previous](https://github.com/bitcoin/bitcoin/pull/18335#pullrequestreview-460621350) review.
  darosior:
    ACK 8dd5946c0b

Tree-SHA512: 33e25f6ff05d9b56fae2bdb68b132557bb8e995f5438ac4fbbc53c304c5152a98aa43c43600c31d8a6a2830cbd48bf8ec7d89dce50190b29ec00a43830126913
2021-03-19 20:52:16 +01:00
MarcoFalke
18cd0888ef
Merge #21328: net, refactor: pass uint16 CService::port as uint16
52dd40a9fe test: add missing netaddress include headers (Jon Atack)
6f09c0f6b5 util: add missing braces and apply clang format to SplitHostPort() (Jon Atack)
2875a764f7 util: add ParseUInt16(), use it in SplitHostPort() (Jon Atack)
6423c8175f p2p, refactor: pass and use uint16_t CService::port as uint16_t (Jon Atack)

Pull request description:

  As noticed during review today in https://github.com/bitcoin/bitcoin/pull/20685#discussion_r584873708 of the upcoming I2P network support, `CService::port` is `uint16_t` but is passed around the codebase and into the ctors as `int`, which causes uneeded conversions and casts. We can avoid these (including in the incoming I2P code without further changes to it) by using ports with the correct type. The remaining conversions are pushed out to the user input boundaries where they can be range-checked and raise with user feedback in the next patch.

ACKs for top commit:
  practicalswift:
    cr ACK 52dd40a9fe: patch looks correct
  MarcoFalke:
    cr ACK 52dd40a9fe
  vasild:
    ACK 52dd40a9fe

Tree-SHA512: 203c1cab3189a206c55ecada77b9548b810281cdc533252b8e3330ae0606b467731c75f730ce9deb07cbaab66facf97e1ffd2051084ff9077cba6750366b0432
2021-03-19 20:47:10 +01:00
MarcoFalke
7f3fd34117
Merge #21481: doc: Tell howto install clang-format on Debian/Ubuntu
ea76f4ac7d Doc: Tell howto install clang-format on Debian/Ubuntu (wodry)

Pull request description:

  Because only macOS wasy mentioned, I was unsure if this would be a macOS specific tool. I guess Linux is more used than Mac, so Linux guide should be there, too.

ACKs for top commit:
  hebasto:
    ACK ea76f4ac7d, every system upgrade via clean installation I do the same.

Tree-SHA512: 75c28540e8815cb41f4cf92784b6349978988b679e4deef9ae77ede951f93516ca13ec7b313ab72865b01273e115b49ed2b67cdcd68015af1b643a6186b190dd
2021-03-19 20:00:48 +01:00
wodry
ea76f4ac7d Doc: Tell howto install clang-format on Debian/Ubuntu
Because only macOS wasy mentioned, I was unsure if this would be a macOS specific tool. I guess Linux is more used than Mac, so Linux guide should be there, too.
2021-03-19 19:24:40 +01:00
MarcoFalke
3a12fdba51
Merge #21235: p2p: Clarify disconnect log message in ProcessGetBlockData, remove send bool
fa81773243 style-only: Remove whitespace (MarcoFalke)
fae77b9e6d net: Simplify ProcessGetBlockData execution by removing send flag. (Patrick Strateman)
fae7c0429f log: Clarify that block request below NODE_NETWORK_LIMITED_MIN_BLOCKS disconnects (MarcoFalke)

Pull request description:

  * Clarify that "ignoring" really means "disconnect" in the log
  * Revive a refactor I took from #13670

ACKs for top commit:
  jnewbery:
    utACK fa81773243
  sipa:
    utACK fa81773243

Tree-SHA512: 0a4fcb979cb82c4e26012881eeaf903c38dfbb85d461476c01e35294760744746a79c48ffad827fe31c1b830f40c6e4240529c71e375146e4d0313c3b7d784ca
2021-03-19 18:56:34 +01:00
MarcoFalke
fa81773243
style-only: Remove whitespace
Can be reviewed with --ignore-all-space
2021-03-18 09:16:11 +01:00
Patrick Strateman
fae77b9e6d
net: Simplify ProcessGetBlockData execution by removing send flag.
Setting the send flag to false can be replaced by simply returning.
2021-03-18 09:15:16 +01:00
MarcoFalke
fae7c0429f
log: Clarify that block request below NODE_NETWORK_LIMITED_MIN_BLOCKS disconnects 2021-03-18 09:12:37 +01:00
MarcoFalke
6834e02c89
Merge #21425: refactor: Pass PeerManagerImpl members only once
fa2a80bf12 refactor: Pass PeerManagerImpl members only once (MarcoFalke)

Pull request description:

  Member variables are already passed to methods via `this`, so no need to pass them another time as function parameter.

ACKs for top commit:
  jnewbery:
    utACK fa2a80bf12
  amitiuttarwar:
    utACK fa2a80bf12

Tree-SHA512: 1743825c7560cc748235e3db03e4cea02ad1f670f1b898d7757da644f12693ba9bb2d3eb09b64b3d10dd2e68f52dea31e26d5e97bdc013759baa0515d3c7055c
2021-03-18 08:58:46 +01:00
fanquake
e057e01b7b
Merge #21162: Net Processing: Move RelayTransaction() into PeerManager
680eb56d82 [net processing] Don't pass CConnman to RelayTransactions (John Newbery)
a38a4e8f03 [net processing] Move RelayTransaction into PeerManager (John Newbery)

Pull request description:

  This is the first part of #21160. It moves the RelayTransaction() function to be a member function of the PeerManager class. This is required in order to move the transaction inventory data into the Peer object, since Peer objects are only accessible from within PeerManager.

ACKs for top commit:
  ajtowns:
    ACK 680eb56d82

Tree-SHA512: 8c93491a4392b6369bb7f090de326a63cd62a088de59026e202f226f64ded50a0cf1a95ed703328860f02a9d2f64d3a87ca1bca9a6075b978bd111d384766235
2021-03-18 14:57:50 +08:00
fanquake
bf7c22f7ff
Merge #21435: doc: Update dependencies.md
bb3f79fbdc doc: Update libnatpmp info in dependencies.md (Hennadii Stepanov)
1a01a5dc8d doc: Update zlib info in dependencies.md (Hennadii Stepanov)

Pull request description:

  Update docs according to the recent changes in the code:
  - #21209 (zlib)
  - #21376 (libnatpmp)

ACKs for top commit:
  fanquake:
    ACK bb3f79fbdc - thanks for keeping this updated.

Tree-SHA512: 48350ad07700aa071ad6c34e4c161aaadc050488fc068cf478e9781d632828187962a4384c1b67c2344145a2c00c3e16cddd09259130af8e9e86cd76cd32900d
2021-03-18 11:40:45 +08:00
fanquake
d6e3ac89d4
Merge #21343: doc: revamp macOS build doc
c180c911b8 doc: revamp macOS build doc (Jarol Rodriguez)

Pull request description:

  This PR makes the macOS build-docs more informative and adds in the following information:
  - Proper descriptions and delineation of required/optional dependencies
  - walk-through of optional dependencies
  - configuration walk-through
  - various other tidbits of information

  This is a part of the efforts done in https://github.com/bitcoin/bitcoin/pull/20601 and https://github.com/bitcoin/bitcoin/pull/20610 to update the docs and introduce some consistency between them.

  This update does not add instructions for arm-based M1 Macbooks as I do not have one to test with. It would be nice to have someone follow up with an update containing instructions for arm-based Macs.

  **Before/Master:** [render](https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md)
  **After/PR:** [render](c180c911b8/doc/build-osx.md)

ACKs for top commit:
  fanquake:
    ACK c180c911b8 - I still think these are getting too verbose and we're duplicating information all over the place; dependencies, configure options, combinations of options etc. However if people are happy to maintain them, I guess it's fine for now, and this revamping has already happened for some of the other build READMEs.

Tree-SHA512: 1440046c723fe80d4158e4a429e3aa8bd93570acb84ad202d5d24c749ab9a89a3aca8b61b49e75e042a4bf4317acd632d3906e1b5808a9052e74209256528b45
2021-03-18 11:36:48 +08:00
Wladimir J. van der Laan
a9d1b40d53
Merge #21415: refactor: remove Optional & nullopt
ebc4ab721b refactor: post Optional<> removal cleanups (fanquake)
57e980d13c scripted-diff: remove Optional & nullopt (fanquake)

Pull request description:

  Same rationale & motivation as #21404, which turned out to be quite low in the number of potential conflicts. Lets see what the bot has to say here.

ACKs for top commit:
  practicalswift:
    cr ACK ebc4ab721b: patch looks correct
  jnewbery:
    utACK ebc4ab721b
  laanwj:
    Code review ACK ebc4ab721b

Tree-SHA512: 550fbeef09b9d35ddefaa805d1755c18c8fd499c4b0f77ebfece8c20296a7abd1cf6c699e2261f92fe3552deeb7555ec2a2287ffe3ab9e98bb9f8612a4d43be3
2021-03-17 12:17:33 +01:00
MarcoFalke
fa2a80bf12
refactor: Pass PeerManagerImpl members only once
Can be reviewed with

--word-diff-regex=. --ignore-all-space
2021-03-17 10:35:30 +01:00
fanquake
ebc4ab721b
refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
fanquake
993ecafa5e
Merge #21417: Misc external signer improvement and HWI 2 support
57ff5a42ab doc: specify minimum HWI version (Sjors Provoost)
03308b2bfa rpc: don't require wallet for enumeratesigners (Sjors Provoost)

Pull request description:

  HWI just released 2.0. See https://github.com/bitcoin-core/HWI/releases/tag/2.0.0

  As of #16546 we already rely on features that are in 2.0 and not in the previous 1.* releases:
  * `--chain` param

  This shouldn't be a problem, because HWI 2.0 has been released before we release v22.

  Misc improvements:
  * document that HWI 2.0 is required
  * drop wallet requirement for `enumeratesigners`

ACKs for top commit:
  achow101:
    Code Review ACK 57ff5a42ab

Tree-SHA512: 3fb6ba20894e52a116f89525a5f5a1f61d363ccd904e1cffd0e6d095640fc6d2edf0388cd6ae20f83bbc31e5f458255ec090b6e823798d426eba3e45b4336bf9
2021-03-17 09:54:27 +08:00
Samuel Dobson
d25e28c20b
Merge #21083: wallet: Avoid requesting fee rates multiple times during coin selection
f9cd2bfbcc Rename CoinSelectionParams::effective_fee to m_effective_feerate (Andrew Chow)
bdd0c2934b wallet: Move discard feerate fetching to CreateTransaction (Andrew Chow)
448d04b931 wallet: Move long term feerate setting to CreateTransaction (Andrew Chow)
e2f429e6bb wallet: Replace nFeeRateNeeded with effective_fee (Andrew Chow)
1a6a0b0dfb wallet: Use existing feerate instead of getting a new one (Andrew Chow)

Pull request description:

  During coin selection, there are various places where we need to have a feerate. We need the feerate for the transaction itself, the discard fee rate, and long term feerate. Fetching these each time we need them can lead to a race condition where two feerates that should be the same are actually different. One particular instance where this can happen is during the loop in `CreateTransactionInternal`. After inputs are chosen, the expected transaction fee is calculated using a newly fetched feerate. If `pick_new_inputs == false`, the loop will go again with the assumption that the fee for the transaction remains the same. However because the feerate is fetched again, it is possible that it actually isn't and this causes coin selection to fail.

  Instead of fetching the feerate each time it is needed, we fetch them all at once at the top of `CreateTransactionInternal`, store them in `CoinSelectionParams`, and use them where needed.

  While some of these fee rates probably don't need this caching, I've done it for consistency and the guarantee that they remain the same.

  Fixes #19229

ACKs for top commit:
  glozow:
    reACK f9cd2bfbcc
  fjahr:
    Code review re-ACK f9cd2bfbcc
  Xekyo:
    tACK f9cd2bfbcc
  meshcollider:
    Code review + test run ACK f9cd2bfbcc

Tree-SHA512: be83ff64ba473c3cdd3469c812e214659b6e2a9584c22ed2b1595618fce0d4b35d0901e61068cd1069fc1a8fb911db01dd7312d05c3b8cbafbe2504ab7a3e863
2021-03-17 13:14:48 +13:00
Andrew Chow
f9cd2bfbcc Rename CoinSelectionParams::effective_fee to m_effective_feerate
It's a feerate, not a fee. Also follow the style guide for member names.
2021-03-16 17:16:57 -04:00
Andrew Chow
bdd0c2934b wallet: Move discard feerate fetching to CreateTransaction
Instead of fetching the discard feerate for each SelectCoinsMinConf
iteration, fetch and cache it once during CreateTransaction so that it
is shared for each SelectCoinsMinConf through
coin_selection_params.m_discard_feerate.

Does not change behavior.
2021-03-16 16:33:27 -04:00
Andrew Chow
448d04b931 wallet: Move long term feerate setting to CreateTransaction
Instead of setting the long term feerate for each SelectCoinsMinConf
iteration, set it once during CreateTransaction and let it be shared
with each SelectCoinsMinConf through
coin_selection_params.m_long_term_feerate.

Does not change behavior.
2021-03-16 16:32:38 -04:00
Jon Atack
52dd40a9fe
test: add missing netaddress include headers 2021-03-16 19:52:37 +01:00
Jon Atack
6f09c0f6b5
util: add missing braces and apply clang format to SplitHostPort() 2021-03-16 19:52:35 +01:00
Jon Atack
2875a764f7
util: add ParseUInt16(), use it in SplitHostPort() 2021-03-16 19:52:33 +01:00
Jon Atack
6423c8175f
p2p, refactor: pass and use uint16_t CService::port as uint16_t 2021-03-16 19:52:31 +01:00
MarcoFalke
5ef16038a1
Merge #21410: test: increase rpc_timeout for fundrawtx test_transaction_too_large
d09120b7d1 test: give fundraw more time for test_transaction_too_large (Jon Atack)

Pull request description:

  to hopefully fix timeouts from a new test added in 48a0319bab of #20536 merged March 8, 2021

  seen locally when running via the test runner

  ```
  File "/home/jon/projects/bitcoin/bitcoin/test/functional/rpc_fundrawtransaction.py", line 927, in test_transaction_too_large
  raise JSONRPCException({
      test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 30.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
  ```
  and in the CI like https://bitcoinbuilds.org/index.php?ansilog=28537952-2c92-46f2-9871-8918e5ba2738.log#l2398
  ```
  File "/home/ubuntu/src/test/functional/rpc_fundrawtransaction.py", line 927, in test_transaction_too_large
  test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 240.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
  ```

Top commit has no ACKs.

Tree-SHA512: f11c923439014fe12420f986c640fd301a26282eb41516957d73b9c751087cbae3d0e316f9ccb49bcb424f488540266f70d3f97948633e77c62bd7935df90452
2021-03-16 19:25:31 +01:00
Hennadii Stepanov
bb3f79fbdc
doc: Update libnatpmp info in dependencies.md 2021-03-16 19:46:15 +02:00
Andrew Chow
e2f429e6bb wallet: Replace nFeeRateNeeded with effective_fee
Make sure that all fee calculations use the same feerate.
coin_selection_params.effective_fee is the variable we use for all fee
calculations, so get rid of remaining nFeeRateNeeded usages and just
directly set coin_selection_params.effective_fee.

Does not change behavior.
2021-03-16 12:32:56 -04:00
Andrew Chow
1a6a0b0dfb wallet: Use existing feerate instead of getting a new one
During each loop of CreateTransaction, instead of constantly getting a
new feerate, use the feerate that we have already fetched for all
fee calculations. Thix fixes a race condition where the feerate required
changes during each iteration of the loop.

This commit changes behavior as the "Fee estimation failed" error will
now take priority over "Signing transaction failed".
2021-03-16 12:30:01 -04:00
Jon Atack
d09120b7d1
test: give fundraw more time for test_transaction_too_large 2021-03-16 17:18:54 +01:00
Wladimir J. van der Laan
01bb3afb51
Merge #21447: Always add -daemonwait to known command line arguments
4d008f908e Always add -daemonwait to known command line arguments (Hennadii Stepanov)

Pull request description:

  This is a follow up of #21007.

  When `AC_CHECK_DECLS([fork])` fails:

  - on master (8e6532053f):
  ```
  $ src/bitcoind -daemonwait
  Error: Error parsing command line arguments: Invalid parameter -daemonwait

  ```

  - with this PR:
  ```
  $ src/bitcoind -daemonwait
  Error: -daemon is not supported on this operating system

  ```

ACKs for top commit:
  laanwj:
    Code review ACK 4d008f908e

Tree-SHA512: 7fcb5e9d76958adcf57e04fa74bd2a98d62459d81a3c57a97bd74c346cbf47c53e560a15455fb024e912c3b44e8487a83499e993b282871ba069953e665d88a9
2021-03-16 15:10:47 +01:00
Wladimir J. van der Laan
1b6c463e03
Merge #21407: i2p: limit the size of incoming messages
7059e6d822 test: add a test to ensure RecvUntilTerminator() limit works (Vasil Dimov)
80a5a8ea2b i2p: limit the size of incoming messages (Vasil Dimov)

Pull request description:

  Put a limit on the amount of data `Sock::RecvUntilTerminator()` can read
  if no terminator is received.

  In the case of I2P this avoids a runaway (or malicious) I2P proxy
  sending us tons of data without a terminator before a timeout is
  triggered.

ACKs for top commit:
  laanwj:
    Re-ACK 7059e6d822

Tree-SHA512: 21f3f3468c765c726cdc877eae847cdb4dbe225d94c5bd1849bd752c9761fac881c554f16ea7a685ad40312159d554e126c481e21c5fd83a6d947060b920373d
2021-03-16 13:11:59 +01:00
Wladimir J. van der Laan
7723479300
Merge #220: Do not translate file extensions
88df300f20 qt: Do not translate file extensions (Hennadii Stepanov)

Pull request description:

  File extensions are untranslatable by their nature.

ACKs for top commit:
  laanwj:
    Concept and code review ACK 88df300f20
  Talkless:
    tACK 88df300f20, tested on Debian Sid with Qt 5.15.2. Tested all filters except for .psbt.
  jarolrod:
    re-ACK 88df300f20

Tree-SHA512: 104d383543edcee8fb825f98d3b6669a7aaae2c74b6602f9bc407bf1c88be121ec535f2f9be87afa6ca775dc79865165f620553f6f6ab1d31a3f9ea93f7f9593
2021-03-16 13:07:10 +01:00
Wladimir J. van der Laan
3b408d21e0
Merge #21438: test: add ParseUInt8() test coverage
76782e560b refactor: reuse test string with embedded null char in util_tests (Jon Atack)
24c6546946 test: add ParseUInt8() unit and fuzz test coverage (Jon Atack)

Pull request description:

  We have unit test and fuzzer coverage for
  - `ParseInt64()`
  - `ParseInt32()`
  - `ParseUInt64()`
  - `ParseUInt32()`

  but not `ParseUInt8()`, so this pull adds it.

  I was tempted to add a commit that applies clang formatting to the file, or one that updates the C-style casts to named casts, but resisted the temptation unless reviewers request it.

ACKs for top commit:
  laanwj:
    Code review ACK 76782e560b
  MarcoFalke:
    cr ACK 76782e560b

Tree-SHA512: 1d7948b3385632094a3b0f0e38f87dccddabf74002e68aa055a51408866b057828ffa15c4b22aa9adde458155fbb5e443b66a9dbf3d7713358fc98a14d64bdcf
2021-03-16 12:06:26 +01:00
Wladimir J. van der Laan
af6ee17545
Merge #21405: compat: remove memcpy -> memmove backwards compatibility alias
52f0be3a93 compat: remove memcpy -> memmove backwards compatibility alias (fanquake)

Pull request description:

  In glib 2.13 memcpy was changed such that the way it copied bytes was reversed.
  This caused all sorts of issues for existing software, which depended on the
  existing behavior (when they should have been using memmove). See:
  https://sourceware.org/bugzilla/show_bug.cgi?id=12518
  https://bugzilla.redhat.com/show_bug.cgi?id=638477

  Now that we require glibc 2.17+ (#17538), we should be well clear of having to
  maintain our memcpy ->  memmove aliasing, which was introduced in #4339.

  Gitian builds:
  ```bash
  # Linux:
  52dee59c8c7d5620ac9b140b79fcaf3d2f15a219293140190f9283ba871f5391  bitcoin-52f0be3a9332-aarch64-linux-gnu-debug.tar.gz
  8963473b8791c5c6033a992d7dd761832fe1fb5732be790a6e9f8c11d67ad8ae  bitcoin-52f0be3a9332-aarch64-linux-gnu.tar.gz
  1fb3365c1ef60ecd1eb2d18f671f8f1e8cde0585de7de74aa0c5121093100c26  bitcoin-52f0be3a9332-arm-linux-gnueabihf-debug.tar.gz
  305c5b032d51ba97459715211112204a09d119edd6ec2a12b796559ad3fde761  bitcoin-52f0be3a9332-arm-linux-gnueabihf.tar.gz
  1f950a3e3979a4e1a67696b3fddc3090a0489a43b49e2b58a348d4b02ada2aa8  bitcoin-52f0be3a9332-powerpc64-linux-gnu-debug.tar.gz
  0b9731dba768b30c91dadec4cd7a98c86e06fbf6354555f798b46b7c4fab7b5f  bitcoin-52f0be3a9332-powerpc64-linux-gnu.tar.gz
  c4a37aae56cc023964f8d9e82d1b66913079cab559cbfc1c9127969aa968a06f  bitcoin-52f0be3a9332-powerpc64le-linux-gnu-debug.tar.gz
  dfbaa4f3bf12988a0a7f82c4b10162e5e7a63382a7e29d0170bc32ce344c97c3  bitcoin-52f0be3a9332-powerpc64le-linux-gnu.tar.gz
  3a0280d2c06516e50b0841d6f42d9589355dc9a1f8bb9a0b123554cd91b08004  bitcoin-52f0be3a9332-riscv64-linux-gnu-debug.tar.gz
  cc199a0f254b2366e80a6a884120ec3ea442983990ba1a5eb993c36060686eba  bitcoin-52f0be3a9332-riscv64-linux-gnu.tar.gz
  eb8e7ca673cc06c167ab082fe457a41f73758ecd5b34941300e3cd378c29b197  bitcoin-52f0be3a9332-x86_64-linux-gnu-debug.tar.gz
  dad19226c0e4c54b78ca2fa85fc28c5bfd1e1178e3f765472bd2f895a1d57145  bitcoin-52f0be3a9332-x86_64-linux-gnu.tar.gz
  ef89be95b84bb7c6fef055634cd20caf2fa5b42441502918dbfbf758bb2daab6  src/bitcoin-52f0be3a9332.tar.gz
  dc61f5ca33330c1609bc56b23f39fef3c1ff5ec6a1799d5b7a18f3c3b3acc9f9  bitcoin-core-linux-22-res.yml
  ```

  Guix builds:
  ```bash
  b50d6399cb59e5e4a9247b12a3eda61de6e51bd87ef1f27b388b75b71dfccf92  output/bitcoin-52f0be3a9332-aarch64-linux-gnu-debug.tar.gz
  23d845dc13e60a581ebdfbaa6063f559a56cce06734e1b50790d2fc13e257793  output/bitcoin-52f0be3a9332-aarch64-linux-gnu.tar.gz
  79094406fe00939bbce17a6d65de5a2686625e871432350c69e674cc80b1491c  output/bitcoin-52f0be3a9332-arm-linux-gnueabihf-debug.tar.gz
  65a91913249a743015eceea5a56c497d606af17270cb7e8a3df10cf729b757ec  output/bitcoin-52f0be3a9332-arm-linux-gnueabihf.tar.gz
  5e75ca5e8cf6934ba5a5a1b4d26c1b361b118e10ef34b73845d038035ddb9b85  output/bitcoin-52f0be3a9332-osx-unsigned.dmg
  774b372696cde8ceab40f6909dadea3fc87b375b495fcfb4ee8a963afd7fbd3a  output/bitcoin-52f0be3a9332-osx-unsigned.tar.gz
  dc4bdfb7b32dcc0b6e876d6d7ab3cb8d1472f21f66546ab70515f96262292e21  output/bitcoin-52f0be3a9332-osx64.tar.gz
  ea178ff9e28439f80129445cf260215c74eea2e610f62ff045061f287675d3ff  output/bitcoin-52f0be3a9332-powerpc64-linux-gnu-debug.tar.gz
  0390687a7aaa3f0a8a78be2deab21116599e5b332f00a2d1fdce97a5bd30e3eb  output/bitcoin-52f0be3a9332-powerpc64-linux-gnu.tar.gz
  52c948719a27f252f5969558abc2718c1e365ea85496322cb4ec97eab8a234cc  output/bitcoin-52f0be3a9332-powerpc64le-linux-gnu-debug.tar.gz
  5a4a8748dffe7e6a5bd07f3f564b1f2052440c4199fe25aaa41675bfb69e61db  output/bitcoin-52f0be3a9332-powerpc64le-linux-gnu.tar.gz
  ba521bd2b4e73aea317821a9e08da9a326c0be3b38d923b35ba14bc68ee6c814  output/bitcoin-52f0be3a9332-riscv64-linux-gnu-debug.tar.gz
  783ea81ab2f6b642b13ebf7882aa822d12f95936574a8848a74b1b8978e6801d  output/bitcoin-52f0be3a9332-riscv64-linux-gnu.tar.gz
  376706fc12e58d7d559a87e1ce64be22eaac3fc32d95c60d603ad893d9128cc1  output/bitcoin-52f0be3a9332-win-unsigned.tar.gz
  7aa48242fb71e29b00992b2be8677f1ea49f2ca82c5355bf0c1d4c8d14635596  output/bitcoin-52f0be3a9332-win64-debug.zip
  41e6461ab573fa8f6ac0f198193e72a4a047bb7a4193f743b937e81739c929cc  output/bitcoin-52f0be3a9332-win64-setup-unsigned.exe
  e2c4ecb05f24577da12f722d848bf6ac89f3f549d6d2bfd30d65676099c0725b  output/bitcoin-52f0be3a9332-win64.zip
  60ed63b3b562fa2141f18f1556a03c2474b75797088cd68fdb3e7d057a6983a3  output/bitcoin-52f0be3a9332-x86_64-linux-gnu-debug.tar.gz
  adb0bb62dc8b99d025a863e921b8e670f4c8f4b5600cd6d79eb552ede10bc8b8  output/bitcoin-52f0be3a9332-x86_64-linux-gnu.tar.gz
  ef89be95b84bb7c6fef055634cd20caf2fa5b42441502918dbfbf758bb2daab6  output/src/bitcoin-52f0be3a9332.tar.gz
  ```

ACKs for top commit:
  laanwj:
    Concept and code review ACK 52f0be3a93

Tree-SHA512: 851634a633cc7d27b10f11436768f3695a7615d5850166c3718028c36d3a7dd56baa2dd1028f47802891703e9f5a1d382f559e388ecef2249e2004edc62d97bf
2021-03-16 11:52:54 +01:00
Wladimir J. van der Laan
cb0aafbd21
Merge #21444: net, doc: Doxygen updates and fixes in netbase.{h,cpp}
8348a3742b net: fix hSocket param in netbase.h::ConnectSocketDirectly() (Jon Atack)
e6bd74b2e5 net: move Doxygen docs from netbase.cpp to netbase.h (Jon Atack)
12cc5704db net: update incorrect Doxygen documentation in netbase.cpp (Jon Atack)

Pull request description:

  While doing #21328, I noticed docs that were out-of-date or in the wrong file.

  The second commit is essentially move-only and is best reviewed with `colorMoved = dimmed-zebra` and `colorMovedWs = allow-indentation-change`.

ACKs for top commit:
  laanwj:
    Code review ACK 8348a3742b

Tree-SHA512: 13dae4abd3009fc43dfffc98e0f7eebcd6ad02afdd6050a7685a2ad4e6aaad93480d93886a2d1bd2375c2439d426494e4a8bc0c60e0e3104bfaa1830831ca663
2021-03-16 11:47:36 +01:00
Vasil Dimov
7059e6d822
test: add a test to ensure RecvUntilTerminator() limit works 2021-03-16 11:00:57 +01:00
Vasil Dimov
80a5a8ea2b
i2p: limit the size of incoming messages
Put a limit on the amount of data `Sock::RecvUntilTerminator()` can read
if no terminator is received.

In the case of I2P this avoids a runaway (or malicious) I2P proxy
sending us tons of data without a terminator before a timeout is
triggered.
2021-03-16 11:00:57 +01:00