Commit Graph

31686 Commits

Author SHA1 Message Date
Hennadii Stepanov
6575d354c8
build: Bump Fonconfig version up to 2.12.6 2021-12-03 17:39:17 +02:00
MarcoFalke
57982f419e
Merge bitcoin/bitcoin#23654: fuzz: Rework rpc fuzz target
fa52a86fd3 fuzz: Rework rpc fuzz target (MarcoFalke)

Pull request description:

  Changes (reason):

  * Return `void` in `CallRPC` (the result is unused anyway)
  * Reduce the `catch`-scope of `std::runtime_error` to `RPCConvertValues` (Code clarity and easier bug-finding)
  * Crash when an internal bug is detected (bugs are bad)

ACKs for top commit:
  shaavan:
    Code Review ACK fa52a86fd3

Tree-SHA512: 576411a0e50bca9be3e6ffaf745001b1808fd37029251f8ec2c279e0671efe91d43dd81fd4ca26871c28b119e593ee2a0043d4b75f44da578f17541ee3afd696
2021-12-03 14:02:51 +01:00
fanquake
c9b63ab61e
Merge bitcoin/bitcoin#23489: build: Qt 5.15.2
c0a1c3ca08 ci: Bump Qt to 5.15.2 in the native Windows task (Hennadii Stepanov)
06aca8aacb doc: Update `build_msvc/README.md` for Qt 5.15.2 (Hennadii Stepanov)
1732eaba4f build, qt: Fix regression in rendering on macOS Big Sur (Hennadii Stepanov)
c870027cc2 build: qt 5.15.2 (fanquake)
904ba2aa40 build: add libxcb_util_wm 0.4.1 (fanquake)
0e2ca89a78 build: add libxcb_util_image 0.4.0 (fanquake)
36af9b6c94 build: add libxcb_util_keysyms 0.4.0 (fanquake)
b3cfbf5af2 build: add libxcb_util_render 0.3.9 (fanquake)
e545b56dc5 build: add libxcb_util 0.4.0 (fanquake)
937b36b5f0 build: libxcb 1.14 (fanquake)
01544dd78c build: freetype 2.11.0 (fanquake)
10ac182f4c build: expat 2.4.1 (fanquake)
d3d547c545 build: xcb_proto 1.14.1 (fanquake)
fc65127244 build: libXau 1.0.9 (fanquake)
0697557321 build: xproto 7.0.31 (fanquake)

Pull request description:

  Hebasto asked for this branch to be resurrected, so here it is.

  Guix Builds:
  ```bash
  9bbbec69cc56255fbe0dd6f63d26b6d76ebc071275cd603a2388baf028a2e5fe  guix-build-c0a1c3ca0894/output/aarch64-linux-gnu/SHA256SUMS.part
  57aee87dedbf3c41e52e7bb18cb52e96a656696699ce0663a35cf6c030ca048a  guix-build-c0a1c3ca0894/output/aarch64-linux-gnu/bitcoin-c0a1c3ca0894-aarch64-linux-gnu-debug.tar.gz
  8d2842ff0995bf53f4ed6f67e3db3d33f4cd1d117b15122d750875a3681dba21  guix-build-c0a1c3ca0894/output/aarch64-linux-gnu/bitcoin-c0a1c3ca0894-aarch64-linux-gnu.tar.gz
  67b342e95d8fa5d897d84e53f5bb5cc8323921d31c51497196b54d2c2d62e915  guix-build-c0a1c3ca0894/output/arm-linux-gnueabihf/SHA256SUMS.part
  f52e8b2e28236a7fb0dd26989c39ef18472161a892f90e62cea26ae7c2daadaf  guix-build-c0a1c3ca0894/output/arm-linux-gnueabihf/bitcoin-c0a1c3ca0894-arm-linux-gnueabihf-debug.tar.gz
  1dce8e6953e52874b98a0f5dafaebf068584984e2c3cd40d3110dd3c5c0d2f8d  guix-build-c0a1c3ca0894/output/arm-linux-gnueabihf/bitcoin-c0a1c3ca0894-arm-linux-gnueabihf.tar.gz
  f8328d777b0f1be68408c2df5907c4dd890dd0617b1aa747b3bf140f84c0f61d  guix-build-c0a1c3ca0894/output/dist-archive/bitcoin-c0a1c3ca0894.tar.gz
  b3e71decb914c3be9c88586084853ab086d77929707c1a7649991b75c734f3e2  guix-build-c0a1c3ca0894/output/powerpc64-linux-gnu/SHA256SUMS.part
  30a8ad718f848297ac1dc8f48eadb37b983d5837f807ecfedb6723932cb5e84a  guix-build-c0a1c3ca0894/output/powerpc64-linux-gnu/bitcoin-c0a1c3ca0894-powerpc64-linux-gnu-debug.tar.gz
  111444d627aa837e8a7f450dfe304ff20139ca018a293c9a5e8c5aec33ab75a9  guix-build-c0a1c3ca0894/output/powerpc64-linux-gnu/bitcoin-c0a1c3ca0894-powerpc64-linux-gnu.tar.gz
  ef815b019722b774995e2a999cdbd79b34b8636f92f62b2f8e6b99b294ad1bc5  guix-build-c0a1c3ca0894/output/powerpc64le-linux-gnu/SHA256SUMS.part
  5521bf88d0febd79301dbed30205c1bef6257eb03ae5d4a5227bac3b66b0b427  guix-build-c0a1c3ca0894/output/powerpc64le-linux-gnu/bitcoin-c0a1c3ca0894-powerpc64le-linux-gnu-debug.tar.gz
  6d2ae36ec34e7b5d3d84d6a50595c39c1d89b2659ed9eba5e7c8b21a9cbb8f04  guix-build-c0a1c3ca0894/output/powerpc64le-linux-gnu/bitcoin-c0a1c3ca0894-powerpc64le-linux-gnu.tar.gz
  8aa9cb8a5585d8b27feafa8403fcba803152fb154d7c308f6759670c11107cfa  guix-build-c0a1c3ca0894/output/riscv64-linux-gnu/SHA256SUMS.part
  7abbf8efdc91399ab0d2dde18b3be19734f956a07ed1cc19f8f5178647f9ac94  guix-build-c0a1c3ca0894/output/riscv64-linux-gnu/bitcoin-c0a1c3ca0894-riscv64-linux-gnu-debug.tar.gz
  1dfd20f75feb316882043dd081f0ee4bd2032481e17d40f7ae9f2b430c316754  guix-build-c0a1c3ca0894/output/riscv64-linux-gnu/bitcoin-c0a1c3ca0894-riscv64-linux-gnu.tar.gz
  1949530e8e68b68c72f627296995b93e9ec048c2740274a8874fe9565eca4a46  guix-build-c0a1c3ca0894/output/x86_64-apple-darwin19/SHA256SUMS.part
  ab2e63f9f58834ddc0fc5f83a2a7938ffcf8057392f0c5ce92a8d456e9b8e4af  guix-build-c0a1c3ca0894/output/x86_64-apple-darwin19/bitcoin-c0a1c3ca0894-osx-unsigned.dmg
  38958a096117542cde4dcac318d116fdeec3237c95ebf88fff0e76570002109e  guix-build-c0a1c3ca0894/output/x86_64-apple-darwin19/bitcoin-c0a1c3ca0894-osx-unsigned.tar.gz
  8841df372ef1ea670dc8d4f82b007420140a39454371be47193e484a4f95fd76  guix-build-c0a1c3ca0894/output/x86_64-apple-darwin19/bitcoin-c0a1c3ca0894-osx64.tar.gz
  4e0d6b6a715d987ff025e45782dd6a47cfdac904a26d932c9c84de7eb8b699d4  guix-build-c0a1c3ca0894/output/x86_64-linux-gnu/SHA256SUMS.part
  3ac4c326313650c0d0a35560c4073f0c3fcbf7002c5b5c918e7186627c8ed392  guix-build-c0a1c3ca0894/output/x86_64-linux-gnu/bitcoin-c0a1c3ca0894-x86_64-linux-gnu-debug.tar.gz
  fcd45fe54cb86a7e9240a6bbe2170926e6db32ee55b821af332348d4c4e1d3a4  guix-build-c0a1c3ca0894/output/x86_64-linux-gnu/bitcoin-c0a1c3ca0894-x86_64-linux-gnu.tar.gz
  72deb4fc1c5b70ae329ab04862e822911708f3c4a4d8a0bbb5796d9a64985414  guix-build-c0a1c3ca0894/output/x86_64-w64-mingw32/SHA256SUMS.part
  78ae8f495bfb02198b00b7fc72b67fb0595f81dd9e3aef45e5103efea90451d9  guix-build-c0a1c3ca0894/output/x86_64-w64-mingw32/bitcoin-c0a1c3ca0894-win-unsigned.tar.gz
  962fcf4ce63e5a89fb1e74e19dbc1aeffc4d5b753ab8e19fcf2249ce21766c5b  guix-build-c0a1c3ca0894/output/x86_64-w64-mingw32/bitcoin-c0a1c3ca0894-win64-debug.zip
  3929916755d599b133304acd94462afad1ba73d5516f6f9786aff565c6ac8818  guix-build-c0a1c3ca0894/output/x86_64-w64-mingw32/bitcoin-c0a1c3ca0894-win64-setup-unsigned.exe
  66e2030476de85437e1593b7d2f4efd4a8837de8b2479217f9246d8028256e08  guix-build-c0a1c3ca0894/output/x86_64-w64-mingw32/bitcoin-c0a1c3ca0894-win64.zip
  ```

ACKs for top commit:
  hebasto:
    re-ACK c0a1c3ca08

Tree-SHA512: 33e7a3e022dfc3a7e93f4bc2acf887c7c2afacc182352f4dfb5917342d5923e0a8d17eaf10928e68b666db6ab748cc02d3d3dfb41e4aad7d296a403b79b3e63d
2021-12-03 20:56:45 +08:00
fanquake
345c8180d7
Merge bitcoin/bitcoin#23630: Remove GetSpendHeight
fa3942fc4c Remove GetSpendHeight (MarcoFalke)

Pull request description:

  It is unclear what the goal of the helper is, as the caller already
  knows the spend height before calling the helper.

  Also, in case the coins view is corrupted, LookupBlockIndex will return
  nullptr. Dereferencing a nullptr is UB.

  Fix both issues by removing it. Also, add a sanity check, which aborts
  if the coins view is corrupted.

ACKs for top commit:
  laanwj:
    Code review ACK fa3942fc4c
  ryanofsky:
    Code review ACK fa3942fc4c. I'm not aware of cases where coins GetBestBlock could be different from active chain tip, and asset seems sufficient to guarantee PR doesn't change behavior if that doesn't happen.

Tree-SHA512: 29f65d72e116ec5a4509e0947ceeaa5bb6b7dfd5d174d3c7945cb15fa266d590c4f8b48e6385de74ef7d7c84ebd2255de902ad9c87c24955348a91b12e5bffd5
2021-12-03 19:09:58 +08:00
MarcoFalke
8b1de78577
Merge bitcoin/bitcoin#23413: Replace MakeSpan helper with Span deduction guide
11daf6ceb1 More Span simplifications (Pieter Wuille)
568dd2f839 Replace MakeSpan helper with Span deduction guide (Pieter Wuille)

Pull request description:

  C++17 supports [user-defined deduction guides](https://en.cppreference.com/w/cpp/language/class_template_argument_deduction), allowing class constructors to be invoked without specifying class template arguments. Instead, the code can contain rules to infer the template arguments from the constructor argument types.

  This alleviates the need for the `MakeSpan` helper. Convert the existing MakeSpan rules into deduction rules for `Span` itself, and replace all invocations of `MakeSpan` with just `Span` ones.

ACKs for top commit:
  MarcoFalke:
    re-ACK 11daf6ceb1 Only change is removing a hunk in the tests 🌕

Tree-SHA512: 10f3e82e4338f39d9b7b407cd11aac7ebe1e9191b58e3d7f4e5e338a4636c0e126b4a1d912127c7446f57ba356c8d6544482e47f97901efea6a54fffbfd7895f
2021-12-03 10:44:37 +01:00
MarcoFalke
fd1c9e26d3
Merge bitcoin/bitcoin#23653: Generalize/simplify VectorReader into SpanReader
2c35a93b3c Generalize/simplify VectorReader into SpanReader (Pieter Wuille)

Pull request description:

  Originally written for #21590 (safegcd-based MuHash inverses), but then found a better way that removed the need for it, so I'm submitting it independently.

ACKs for top commit:
  MarcoFalke:
    re-ACK 2c35a93b3c 🖨
  shaavan:
    ACK 2c35a93b3c

Tree-SHA512: 959e3251e0cfe20e13a50639b617c9dc2a561d613a0884d983c93d15dacb6d2305d760aa933d18ba055cef8a1651a344bcb6b3f93051ecf26d3f2efc5779efa4
2021-12-03 10:25:24 +01:00
MarcoFalke
0ee9a00f90
Merge bitcoin/bitcoin#23652: doc: Document optional RPC result fields
fab6c43b40 doc: Document optional result fields in validateaddress (MarcoFalke)
faee2656a8 doc: Document optional result fields in getpeerinfo (MarcoFalke)

Pull request description:

ACKs for top commit:
  shaavan:
    ACK fab6c43b40

Tree-SHA512: 78458d0c4deb9253fbfe37fa5736a7db14eb0478bcc4adeba10ba6945e83d8eac92048293f50c054ea612609939151b4a2e1226c06f6067901f3d58c127c7e18
2021-12-03 10:14:05 +01:00
MarcoFalke
8b4d53e4d6
Merge bitcoin/bitcoin#23647: MOVEONLY: Move wallet backup and encryption RPCs out of rpcwallet
5b2167fd30 MOVEONLY: Move LoadWalletHelper to wallet/rpc/util (Samuel Dobson)
8b73640152 MOVEONLY: Move wallet encryption RPCs to encrypt.cpp (Samuel Dobson)
803b30502b MOVEONLY: Move backupwallet and restorewallet to rpc/backup.cpp (Samuel Dobson)
3a9d39324e MOVEONLY: Move rpcdump.cpp to wallet/rpc/backup.cpp (Samuel Dobson)

Pull request description:

  As part of an effort to split rpcwallet as per #23622, this moves `rpcdump.cpp` into the new wallet/rpc directory as well as moving backup and encryption RPCs out of rpcwallet.

ACKs for top commit:
  MarcoFalke:
    ACK 5b2167fd30 🎭

Tree-SHA512: aa8054767927fa56b5c51edc91a2d94fe9f1cca198e1b2cac1ebd464f6956a89c782a7b6de4409361adca6ca1377272b6e2af660b737c4849ee323f899945ad9
2021-12-03 09:17:15 +01:00
Hennadii Stepanov
c0a1c3ca08
ci: Bump Qt to 5.15.2 in the native Windows task 2021-12-03 14:07:12 +08:00
Hennadii Stepanov
06aca8aacb
doc: Update build_msvc/README.md for Qt 5.15.2 2021-12-03 14:07:12 +08:00
Hennadii Stepanov
1732eaba4f
build, qt: Fix regression in rendering on macOS Big Sur 2021-12-03 14:07:12 +08:00
fanquake
c870027cc2
build: qt 5.15.2 2021-12-03 14:07:12 +08:00
fanquake
904ba2aa40
build: add libxcb_util_wm 0.4.1
Required for xcb_icccm.
2021-12-03 14:07:12 +08:00
fanquake
0e2ca89a78
build: add libxcb_util_image 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
36af9b6c94
build: add libxcb_util_keysyms 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
b3cfbf5af2
build: add libxcb_util_render 0.3.9 2021-12-03 14:07:11 +08:00
fanquake
e545b56dc5
build: add libxcb_util 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
937b36b5f0
build: libxcb 1.14
Minimum required libxcb to build qt 5.15.x is 1.11.

https://codereview.qt.nokia.com/c/qt/qtbase/+/253905

Some plugins have been re-enabled as they are required by Qt.
2021-12-03 14:07:10 +08:00
fanquake
01544dd78c
build: freetype 2.11.0
Co-authored-by: mammix2 <mammix2@hotmail.com>
2021-12-03 14:07:10 +08:00
fanquake
10ac182f4c
build: expat 2.4.1 2021-12-03 14:07:10 +08:00
fanquake
d3d547c545
build: xcb_proto 1.14.1 2021-12-03 14:07:10 +08:00
fanquake
fc65127244
build: libXau 1.0.9 2021-12-03 14:07:10 +08:00
fanquake
0697557321
build: xproto 7.0.31 2021-12-03 14:07:09 +08:00
fanquake
927a9b0777
Merge bitcoin/bitcoin#23659: test: fix: remove outdated TestNode.generate calls
4e1cb904ba test: fix: remove outdated TestNode.generate calls (James O'Beirne)

Pull request description:

  Currently failing on CI. After this change the test itself still fails,
  but at least it's apparently for a non-incidental reason.

ACKs for top commit:
  meshcollider:
    ACK 4e1cb904ba
  theStack:
    Tested ACK 4e1cb904ba

Tree-SHA512: 5e7059d334d571ca92f250d298292ce1653da8257cbfb218d28cc9c5816c21c718c36482da31fcaf78e0714cc9b67ff04b91405e820accaf4d8321a354af9441
2021-12-03 12:37:58 +08:00
fanquake
ffe414bd9a
Merge bitcoin/bitcoin#23649: circular dependency followups
ddd74ff65c clean up txmempool includes (glozow)
c4efc4db54 change TestLockPointValidity to take a const reference (glozow)
b01784f027 remove unnecessary casts and use braced initialization (glozow)

Pull request description:

  Followups from #22677 + clean up `TestLockPointValidity`

ACKs for top commit:
  theStack:
    Code-review ACK ddd74ff65c

Tree-SHA512: 0f7f26535b7301e2fb379e676310bdc7cfb2c5e232a6657f41dc6d3bc91583ec452eb2359ad2f2416ea12dd856f7fab3fa507a391ccf80f14de96da989281d96
2021-12-03 12:20:46 +08:00
Samuel Dobson
5b2167fd30 MOVEONLY: Move LoadWalletHelper to wallet/rpc/util 2021-12-03 13:53:12 +13:00
Samuel Dobson
8b73640152 MOVEONLY: Move wallet encryption RPCs to encrypt.cpp 2021-12-03 12:34:01 +13:00
Samuel Dobson
803b30502b MOVEONLY: Move backupwallet and restorewallet to rpc/backup.cpp 2021-12-03 12:33:33 +13:00
Samuel Dobson
3a9d39324e MOVEONLY: Move rpcdump.cpp to wallet/rpc/backup.cpp 2021-12-03 12:33:33 +13:00
James O'Beirne
4e1cb904ba
test: fix: remove outdated TestNode.generate calls
Currently failing on CI. After this change the test itself still fails,
but at least it's apparently for a non-incidental reason.
2021-12-02 17:07:08 -05:00
Pieter Wuille
2c35a93b3c Generalize/simplify VectorReader into SpanReader 2021-12-02 14:47:17 -05:00
MarcoFalke
0b30bdd519
Merge bitcoin/bitcoin#22014: refactor: Make m_cs_fee_estimator non-recursive
8c277b19c8 refactor: Make m_cs_fee_estimator non-recursive (Hennadii Stepanov)
5ee5b696b5 refactor: Add non-thread-safe CBlockPolicyEstimator::_removeTx helper (Hennadii Stepanov)
5c3033d45e Add thread safety annotations to CBlockPolicyEstimator public functions (Hennadii Stepanov)

Pull request description:

  This PR eliminates the only place that `m_cs_fee_estimator` is recursively locked by refactoring out `_removeTx` member function.

  Related to #19303.

ACKs for top commit:
  theStack:
    Code-review ACK 8c277b19c8
  amadeuszpawlik:
    ACK 8c277b19c8 reviewed, built and ran tests

Tree-SHA512: 65b0b59460d3d5fadf7e75e916b2898b0dcfafdf5b278ef8c3975660f67c9f88ae4b937944313bd36d7513a7a53e1e5859aaf4a6deb4a1aea089936b101635a1
2021-12-02 19:54:21 +01:00
W. J. van der Laan
bce58bbb3d
Merge bitcoin/bitcoin#22929: wallet: Automatically add receiving destinations to the address book
3d71d16d1e test: listtranscations with externally generated addresses (S3RK)
d04566415e Add to spends only transcations from me (S3RK)
9f3a622b1c Automatically add labels to detected receiving addresses (S3RK)
c1b99c088c Return used destinations from ScriptPubKeyMan::MarkUnusedAddresses (S3RK)
03840c2064 Add CWallet::IsInternalScriptPubKeyMan (S3RK)
456e350926 wallet: resolve ambiguity of two ScriptPubKey managers providing same script (S3RK)

Pull request description:

  This PR fixes certain use-cases when **send-to-self** transactions are missing from `listtransactions` output.

  1. When a receiving address is generated externally to the wallet
  (e.g. same wallet running on two nodes, or by 3rd party from xpub)
  2. When restoring backup with lost metadata, but keypool gap is not exceeded yet

  When the block is connected or tx added to mempool we already mark used keys. This PR extends this logic to determine whether the destination is a receiving one and if yes add it to the address book with empty label.

  Works both for legacy and descriptors wallets.
  - For legacy it uses the internal flag from the keypool entry. Caveat: because we don't know which script type would be used we add all possible destinations for such keys.
  - For descriptor wallets it uses internal flag for the script pub key manager. Caveat: it only works for active descriptors.

  fixes #19856
  fixes #20293

ACKs for top commit:
  laanwj:
    Code review ACK 3d71d16d1e

Tree-SHA512: 03fafd5548ead0c4ffe9ebcc9eb2849f1d2fa7270fda4166419b86877d4e57dcf04460e465fbb9c90b42031f3c05d1b83f1b67a9f82c2a42980825ed1e7b52e6
2021-12-02 19:37:33 +01:00
MarcoFalke
fab6c43b40
doc: Document optional result fields in validateaddress
Can be reviewed with --ignore-all-space --word-diff-regex=.
2021-12-02 19:22:35 +01:00
MarcoFalke
fa52a86fd3
fuzz: Rework rpc fuzz target 2021-12-02 19:08:43 +01:00
MarcoFalke
faee2656a8
doc: Document optional result fields in getpeerinfo
Can be reviewed with --ignore-all-space --word-diff-regex=.
2021-12-02 17:38:18 +01:00
MarcoFalke
fa3942fc4c
Remove GetSpendHeight
It is unclear what the goal of the helper is, as the caller already
knows the spend height before calling the helper.

Also, in case the coins view is corrupted, LookupBlockIndex will return
nullptr. Dereferencing a nullptr is UB.

Fix both issues by removing it. Also, add a sanity check, which aborts
if the coins view is corrupted.
2021-12-02 15:59:53 +01:00
glozow
ddd74ff65c clean up txmempool includes 2021-12-02 14:49:19 +00:00
glozow
c4efc4db54 change TestLockPointValidity to take a const reference
The lockpoints are not changed in this function.
There is no reason to pass a pointer.
2021-12-02 14:45:18 +00:00
MarcoFalke
26a1147ce5
Merge bitcoin/bitcoin#23636: Remove GetAdjustedTime from init.cpp
fa551b3bdd Remove GetAdjustedTime from init.cpp (MarcoFalke)
fa815f8473 Replace addrman.h include with forward decl in net.h (MarcoFalke)

Pull request description:

  It seems confusing to call `GetAdjustedTime` there, because no offset could have been retrieved from the network at this point. Even if connman was started, `timedata` needs at least 5 peer connections to calculate an offset.

  Fix the confusion by replacing `GetAdjustedTime` with `GetTime`, which does not change behavior.

  Also:
  * Replace magic number with `MAX_FUTURE_BLOCK_TIME` to clarify the context
  * Add test, which passes both on current master and this pull request
  * An unrelated refactoring commit, happy to drop

ACKs for top commit:
  dongcarl:
    Code Review ACK fa551b3bdd, noticed the exact same thing here: e073634c37
  mzumsande:
    Code Review ACK fa551b3bdd
  jnewbery:
    Code review ACK fa551b3bdd
  shaavan:
    ACK fa551b3bdd
  theStack:
    Code-review ACK fa551b3bdd

Tree-SHA512: 15807a0e943e3e8d8c5250c8f6d7b56afb26002b1e290bf93636a2c747f27e78f01f1de04ce1a83d6339e27284c69c43e077a8467545c4078746f4c1ecb1164d
2021-12-02 15:24:55 +01:00
MarcoFalke
0bd7ca9a03
Merge bitcoin/bitcoin#23642: refactor: Call type-solver earlier in decodescript
3333070208 refactor: Call type-solver earlier in decodescript (MarcoFalke)
fab0d998f4 style: Remove whitespace (MarcoFalke)

Pull request description:

  The current logic is a bit confusing. First creating the `UniValue` return dict, then parsing it again to get the type as `std::string`.

  Clean this up by using a strong type `TxoutType`. Also, remove whitespace.

ACKs for top commit:
  shaavan:
    ACK 3333070208
  theStack:
    Code-review ACK 3333070208

Tree-SHA512: 49db7bc614d2491cd3ec0177d21ad1e9924dbece1eb5635290cd7fd18cb30adf4711b891daf522e7c4f6baab3033b66393bbfcd1d4726f24f90a433124f925d6
2021-12-02 13:56:57 +01:00
glozow
b01784f027 remove unnecessary casts and use braced initialization 2021-12-02 12:04:17 +00:00
W. J. van der Laan
6acda4b00b
Merge bitcoin/bitcoin#23155: rpc: various fixups for dumptxoutset
ffd09281fe rpc: various fixups for dumptxoutset (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11) (parent PR: #15606)

  ---

  A few fixes to make this RPC actually useful when generating snapshots.

  - Generate an assumeutxo hash and display it (sort of a bugfix)
  - Add nchaintx to output (necessary for use in chainparams entry)
  - Add path of serialized UTXO file to output

ACKs for top commit:
  laanwj:
    Code review ACK ffd09281fe

Tree-SHA512: b0b5fd5138dea0e21258b1b18ab75bf3fd1628522cc1dbafa81af9cb9fa96562a1c39124fdb31057f256bfc560f462f907e9fe5e209b577b3f57afae2b7be826
2021-12-02 10:35:02 +01:00
fanquake
282cc0cda7
Merge bitcoin/bitcoin#23626: refactor: Fix implicit-signed-integer-truncation in cuckoocache.h
fa7da227da refactor: Fix implicit-signed-integer-truncation in cuckoocache.h (MarcoFalke)

Pull request description:

  Using a file-wide suppression for this implicit truncation has several issues:

  * It is file-wide, thus suppressing any other (newly introduced) issues
  * The file doesn't compile with `-Wimplicit-int-conversion`

  Fix both issues by making the truncation explicit.

ACKs for top commit:
  fanquake:
    ACK fa7da227da

Tree-SHA512: bf2076ed94c4e80d0d29ff883080edc7a73144c73d6d3e872ec87966177ee3160f4760fc4c774aaa6fb591f4acee450a24b0f7c82291e0bef96582a6d134046e
2021-12-02 16:25:54 +08:00
MarcoFalke
af1067c4b7
Merge bitcoin/bitcoin#23640: MOVEONLY: Move helper functions from rpcwallet to wallet/rpc/util
ff945e553a MOVEONLY: Move utility functions from rpcwallet to wallet/rpc/util (Samuel Dobson)
7b04a064f6 Introduce wallet/rpc/util (Samuel Dobson)

Pull request description:

  This is part one of multiple to split up rpcwallet.cpp into smaller, more logical units.

  See #23622 for context and overall plan. I'll open PRs in stages to hopefully minimise conflicts.

  Can be reviewed with `--color-moved=dimmed-zebra`

  The end goal can be seen here: https://github.com/meshcollider/bitcoin/tree/202111_split_walletrpc

ACKs for top commit:
  MarcoFalke:
    nice, ACK ff945e553a 🐰
  shaavan:
    ACK ff945e553a

Tree-SHA512: 6e3d1de6db770fe2fca540c8c4f30183ab8258c26e3a1fb46937714d28818a52933eafbfcafe2995f6a6e2551a3f3dd3ec93363b81de7912c0d81f5749d1c86d
2021-12-02 08:38:32 +01:00
MarcoFalke
a377510e3a
Merge bitcoin/bitcoin#23643: rpc: remove info about mallocinfo needing glibc 2.10+
9a09d307e9 rpc: remove info about mallocinfo needing glibc 2.10+ (fanquake)

Pull request description:

  We require glibc 2.18+.

ACKs for top commit:
  jarolrod:
    ACK 9a09d307e9
  shaavan:
    ACK 9a09d307e9

Tree-SHA512: 61312e48fda4cb4c788d44be0f0c626e753b0a18a8f36bca813ce838f8e619e73c00306bb716e9863a077c09b5bcdec7dec134d75c5ace719a5c0a05cf75ed8a
2021-12-02 08:31:51 +01:00
fanquake
df562d698a
Merge bitcoin/bitcoin#23637: miner: Remove uncompiled MTP code
fa46ac4d9d miner: Remove uncompiled MTP code (MarcoFalke)
fa6b7adf96 style: Add {} to if-bodies in node/miner (MarcoFalke)

Pull request description:

  This removes uncompiled code.

  Can be checked by inserting `static_assert(STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)` and compiling or by reading the source code.

  Even if the code was compiled, it would be unsafe to execute, since it is not allowed to include transactions that are locked until some time after the current MTP.

  Also, rename the member to cause explicit merge conflicts in case there is a patch out there referencing the variable.

ACKs for top commit:
  shaavan:
    ACK fa46ac4d9d
  theStack:
    Code-review ACK fa46ac4d9d

Tree-SHA512: 0288f45918996b58d0c0060773aa3cb15c828a649439f3d589c5d6b4854d6da1d8c2ea11d5ca06c654532453ab5ce1892de7ca820e284e96e78b959ef87cac5c
2021-12-02 10:09:42 +08:00
MarcoFalke
4633199cc8
Merge bitcoin/bitcoin#22677: cut the validation <-> txmempool circular dependency 2/2
a64078e385 Break validation <-> txmempool circular dependency (glozow)
64e4963c63 [mempool] always assert coin spent (glozow)
bb9078ed51 [refactor] put finality and maturity checking into a lambda (glozow)
bedf246f1e [mempool] only update lockpoints for non-removed entries (glozow)
1b3a11e126 MOVEONLY: TestLockPointValidity to txmempool (glozow)

Pull request description:

  Remove 2 circular dependencies: validation - txmempool and validation - policy/rbf - txmempool

  Validation should depend on txmempool (e.g. `CChainstateManager` has a mempool and we often need to know what's in our mempool to validate transactions), but txmempool is a data structure that shouldn't really need to know about chain state.

  - Changes `removeForReorg()` to be parameterized by a callable that returns true/false (i.e. whether the transaction should be removed due to being now immature or nonfinal) instead of a `CChainState`. The mempool really shouldn't need to know about coinbase maturity or lockpoints, it just needs to know which entries to remove.

ACKs for top commit:
  laanwj:
    Code review ACK a64078e385
  mjdietzx:
    reACK a64078e385
  theStack:
    re-ACK a64078e385

Tree-SHA512: f75995200569c09dfb8ddc09729da66ddb32167ff1e8a7e72f105ec062d2d6a9a390e6b4a2a115e7ad8ad3525f891ee1503f3cd2bed11773abcaf7c3230b1136
2021-12-01 17:56:08 +01:00
MarcoFalke
1c06e1a7b6
Merge bitcoin/bitcoin#23437: refactor: AcceptToMemoryPool
123f5de826 Remove calls to global Params() in tx_pool test (lsilva01)
9360778d6e Remove AcceptToMemoryPoolWithTime (lsilva01)

Pull request description:

  This PR refactors AcceptToMemoryPool.

  . Remove `AcceptToMemoryPoolWithTime` (after #23173, this function is no longer needed).
  . Remove the `CChainParams chainparams` parameter from ATMP as they can be inferred from the current chain state.
  . Update the `tx_pool` test with new function signature.

ACKs for top commit:
  jnewbery:
    reACK 123f5de826
  glozow:
    light code review ACK 123f5de826
  theStack:
    re-ACK 123f5de826

Tree-SHA512: b672d9f091f5fcb4d163c0a443aa469b2ce6f37201136803201c620c3fa329ffb41abd50c5b528787fd1c47e8e09af5ec20ddaa0a4235352c9c619e5691dddb6
2021-12-01 17:44:25 +01:00
lsilva01
123f5de826 Remove calls to global Params() in tx_pool test 2021-12-01 10:48:55 -03:00