Commit graph

35512 commits

Author SHA1 Message Date
Jon Atack
1abaa31aa3 Update -debug and -debugexclude help docs for severity level logging 2022-08-20 11:55:17 +02:00
Jon Atack
45f9282162 Create BCLog::Level::Trace log severity level
for verbose log messages for development or debugging only, as bitcoind may run
more slowly, that are more granular/frequent than the Debug log level, i.e. for
very high-frequency, low-level messages to be logged distinctly from
higher-level, less-frequent debug logging that could still be usable in production.

An example would be to log higher-level peer events (connection, disconnection,
misbehavior, eviction) as Debug, versus Trace for low-level, high-volume p2p
messages in the BCLog::NET category. This will enable the user to log only the
former without the latter, in order to focus on high-level peer management events.

With respect to the name, "trace" is suggested as the most granular level
in resources like the following:
- https://sematext.com/blog/logging-levels
- https://howtodoinjava.com/log4j2/logging-levels

Update the test framework and add test coverage.
2022-08-20 11:55:17 +02:00
klementtan
2a8712db4f Unit test coverage for -loglevel configuration option
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20 11:55:17 +02:00
klementtan
eb7bee5f84 Create -loglevel configuration option
- add a -loglevel=<level>|<category:level> config option to allow users
  to set a global -loglevel and category-specific log levels. LogPrintLevel
  messages with a higher severity level than -loglevel will not be printed
  in the debug log.

- for now, this config option is debug-only during the migration to
  severity-based logging

- update unit and functional tests

Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20 11:53:37 +02:00
klementtan
98a1f9c687 Unit test coverage for log severity levels
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20 11:31:28 +02:00
klementtan
9c7507bf76 Create BCLog::Logger::LogLevelsString() helper function
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20 11:31:28 +02:00
klementtan
8fe3457dbb Update LogAcceptCategory() and unit tests with log severity levels
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20 11:30:51 +02:00
klementtan
c2797cfc60 Add BCLog::Logger::SetLogLevel()/SetCategoryLogLevel() for string inputs
and remove unnecessary param constness in LogPrintStr()

Co-authored-by: jonatack <jon@atack.com>
2022-08-20 11:30:50 +02:00
Jon Atack
f6c0cc0350 Add BCLog::Logger::m_category_log_levels data member and getter/setter
Co-authored-by: "klementtan <klementtan@gmail.com>"
2022-08-20 11:30:50 +02:00
Jon Atack
2978b387bf Add BCLog::Logger::m_log_level data member and getter/setter
Co-authored-by: "klementtan <klementtan@gmail.com>"
2022-08-20 11:30:35 +02:00
MacroFake
fa875349e2
Fix iwyu 2022-08-20 09:33:01 +02:00
MacroFake
faad673716
Fix issues when calling std::move(const&) 2022-08-20 09:32:53 +02:00
MacroFake
c73c8d53fe
Merge bitcoin/bitcoin#25878: tests: Use mocktime for wallet encryption timeout
02dea9a47f tests: Use mocktime for wallet encryption timeout (Andrew Chow)

Pull request description:

  The intermittent wallet_encryption.py failures are related to differences in time between python and std::chrono. We can avoid this entirely by using mocktime. This also allows us to test for the exact unlocking time rather than that it is greater than expected.

  Fixes #25482

ACKs for top commit:
  MarcoFalke:
    review ACK 02dea9a47f
  vasild:
    ACK 02dea9a47f

Tree-SHA512: 5a5489f5cd2569c824bf5b3d839be0c632ed27627c0eff65dda63c143a8d1174fe3252acba8102b4242a9ddf42d82bfe79babad68f1beeb83eb251386058e039
2022-08-20 08:50:19 +02:00
Robert Spigler
3a71da0b72
Security config warning
https://github.com/bitcoin/bitcoin/issues/23412

Warning about modifying unknown config changes
2022-08-19 23:18:13 -04:00
Andrew Chow
c3b099ace0 wallet, tests: Test bumpfee's max input weight calculation 2022-08-19 14:37:36 -04:00
Andrew Chow
116a620ce7 Make DUMMY_CHECKER availble outside of script/sign.cpp 2022-08-19 14:37:36 -04:00
Andrew Chow
ff638323d1 test, bumpfee: Check that psbtbumpfee can bump txs with external inputs 2022-08-19 14:37:36 -04:00
Andrew Chow
02dea9a47f tests: Use mocktime for wallet encryption timeout 2022-08-19 13:51:39 -04:00
MacroFake
faf8da3c8d
Remove Join() helper only used in tests
Also remove redundant return type that can be deduced by the compiler.
2022-08-19 19:44:16 +02:00
Andrew Chow
6b56873b41
Merge bitcoin/bitcoin#25784: Wallet: Document expectations for AddWalletFlags (now InitWalletFlags) correctly
0cb6d2aec6 Bugfix: Wallet: Document expectations for AddWalletFlags (now InitWalletFlags) correctly (Luke Dashjr)

Pull request description:

  Includes some slight refactoring (return type changed, current status checked)

ACKs for top commit:
  achow101:
    ACK 0cb6d2aec6
  w0xlt:
    ACK 0cb6d2aec6
  ryanofsky:
    Code review ACK 0cb6d2aec6. This is a clarifying change, and should prevent the InitWalletFlags method being called incorrectly. I left a comment suggestion, but feel free to ignore it.

Tree-SHA512: fa18e9471b5e89d35cbc01526e6d4dbe4eee8faa9646847248909af1751b33014a6f9a42fe70a1331c0d73adea79008b8fc3ae2b51a641eba3e36d5c631327f6
2022-08-19 12:12:27 -04:00
Andrew Chow
0f0508bc72
Merge bitcoin/bitcoin#25869: wallet: remove UNKNOWN type from OUTPUT_TYPES array
5b4fdbbff5 wallet: remove UNKNOWN type from OUTPUT_TYPES array (furszy)

Pull request description:

  Fixing https://github.com/bitcoin/bitcoin/pull/25734#discussion_r949502998 ->  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50329

  The `OUTPUT_TYPES` array contain the known active output types only.
  And it's solely used to create/walk-through the active spkms.

  So, no need to add the `UNKNOWN` type here.

ACKs for top commit:
  achow101:
    ACK 5b4fdbbff5
  w0xlt:
    ACK 5b4fdbbff5
  LarryRuane:
    ACK 5b4fdbbff5

Tree-SHA512: dee2dc362a1b0c777555e5ee4d355a3351340591d0096f74e8c3a25f374cb2d9aef26145977ff4dd0f8cc940da9464eb5541eb2895bc19f8cbd6bb6d292ab9a9
2022-08-19 12:01:23 -04:00
Andrew Chow
1bc8106d4c bumpfee: be able to bump fee of a tx with external inputs
In some cases, notably psbtbumpfee, it is okay, and potentially desired,
to be able to bump the fee of a transaction which contains external
inputs.
2022-08-19 11:27:01 -04:00
Andrew Chow
31dd3dc9e5 bumpfee: Clear scriptSigs and scriptWitnesses before calculated max size
The max size calculation expects some inputs to have empty scriptSigs
and witnesses, so we need to clear these before doing that calculation.
2022-08-19 11:27:01 -04:00
Andrew Chow
a0c3afb898 bumpfee: extract weights of external inputs when bumping fee
When bumping the fee of a transaction containing external inputs,
determine the weights of those inputs. Because signatures can have a
variable size, the script is executed with a special SignatureChecker
which will compute the total weight of the signatures in the transaction
and the weight if they were all maximum size signatures. This allows us
to compute the maximum weight of the input for use during coin
selection.
2022-08-19 11:27:01 -04:00
Andrew Chow
612f1e44fe bumpfee: Calculate fee by looking up UTXOs
Instead of calculating the fee by using what is stored in the wallet,
calculate it by looking up the UTXOs.
2022-08-19 11:27:01 -04:00
MacroFake
9eaef10801
Merge bitcoin/bitcoin#25707: refactor: Make const references to avoid unnecessarily copying objects and enable two clang-tidy checks
ae7ae36d31 tidy: Enable two clang-tidy checks (Aurèle Oulès)
081b0e53e3 refactor: Make const refs vars where applicable (Aurèle Oulès)

Pull request description:

  I added const references to some variables to avoid unnecessarily copying objects.

  Also added two clang-tidy checks : [performance-for-range-copy](https://releases.llvm.org/11.1.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance-for-range-copy.html) and [performance-unnecessary-copy-initialization](https://releases.llvm.org/12.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/performance-unnecessary-copy-initialization.html).

ACKs for top commit:
  vasild:
    ACK ae7ae36d31
  MarcoFalke:
    review ACK ae7ae36d31

Tree-SHA512: f6ac6b0cd0eee1e0c34d2f186484bc0f7ec6071451cccb33fa88a67d93d92b304e2fac378b88f087e94657745bca4e966dbc443759587400eb01b1f3061fde8c
2022-08-19 17:11:06 +02:00
MacroFake
d480586ecb
Merge bitcoin/bitcoin#25808: fs: work around u8path deprecated-declaration warnings with libc++
ced00f5a2e fs: work around u8path deprecated-declaration warnings with libc++ (fanquake)

Pull request description:

  When building in c++20 mode using libc++, the following warning is emitted:
  ```bash
  ./fs.h:72:29: warning: 'u8path<std::string>' is deprecated [-Wdeprecated-declarations]
      return std::filesystem::u8path(utf8_str);
                              ^
  /usr/lib/llvm-14/bin/../include/c++/v1/__filesystem/u8path.h:72:27: note: 'u8path<std::string>' has been explicitly marked deprecated here
  _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
                            ^
  /usr/lib/llvm-14/bin/../include/c++/v1/__config:1042:43: note: expanded from macro '_LIBCPP_DEPRECATED_WITH_CHAR8_T'
                                            ^
  /usr/lib/llvm-14/bin/../include/c++/v1/__config:1007:48: note: expanded from macro '_LIBCPP_DEPRECATED'
                                                 ^
  1 warning generated.
  ```

  as [`u8path<std::string>`](https://en.cppreference.com/w/cpp/filesystem/path/u8path) is deprecated starting with C++20.

  Fixes: #24682.

ACKs for top commit:
  MarcoFalke:
    review ACK ced00f5a2e
  hebasto:
    ACK ced00f5a2e

Tree-SHA512: f012c4f0bec691090eb3ff128ee0cdc392f73e7857b97131da924ab18c088a82d2fba95316d405feb8b744cba63bfeff7b08143086c173fddbf972139ea0ac0b
2022-08-19 13:50:24 +02:00
fanquake
cc8dff5f8f
depends: Boost 1.80.0
https://www.boost.org/users/history/version_1_80_0.html
2022-08-19 10:47:30 +01:00
MacroFake
02aefa169a
Merge bitcoin/bitcoin#25852: build: reorder CXXFLAGS in intrinsic checks
4349051dd4 build: reorder cxxflags in intrinsic checks (fanquake)

Pull request description:

  Let the user have the final say in regards to using intrinsics.

  As outlined in https://github.com/bitcoin/bitcoin/issues/13758, on master:
   ```bash
  ./autogen.sh
  ./configure CXXFLAGS="-mno-avx -mno-avx2"
  …
  checking whether C++ compiler accepts -mavx -mavx2... yes
  checking for AVX2 intrinsics... yes
  …
  make
  …
   crypto/sha256_avx2.cpp: In function ‘__m256i sha256d64_avx2::{anonymous}::K(uint32_t)’:
  crypto/sha256_avx2.cpp:15:28: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
     15 | __m256i inline K(uint32_t x) { return _mm256_set1_epi32(x); }
        |                            ^
  crypto/sha256_avx2.cpp: In function ‘__m256i sha256d64_avx2::{anonymous}::Inc(__m256i&, __m256i)’:
  crypto/sha256_avx2.cpp:21:16: note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
     21 | __m256i inline Inc(__m256i& x, __m256i y) { x = Add(x, y); return x; }
        |                ^~~
  In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:43,
                   from crypto/sha256_avx2.cpp:8:
  /usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h: In function ‘__m256i sha256d64_avx2::{anonymous}::K(uint32_t)’:
  /usr/lib/gcc/x86_64-linux-gnu/11/include/avxintrin.h:1326:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_set1_epi32(int)’: target specific option mismatch
   1326 | _mm256_set1_epi32 (int __A)
        | ^~~~~~~~~~~~~~~~~
  crypto/sha256_avx2.cpp:15:56: note: called from here
     15 | __m256i inline K(uint32_t x) { return _mm256_set1_epi32(x); }
        |                                       ~~~~~~~~~~~~~~~~~^~~
  make[2]: *** [Makefile:13455: crypto/libbitcoin_crypto_avx2_la-sha256_avx2.lo] Error 1
  ```

  with this branch:
  ```bash
  ./autogen.sh
  ./configure CXXFLAGS="-mno-avx -mno-avx2"
  …
  checking whether C++ compiler accepts -mavx -mavx2... yes
  checking for AVX2 intrinsics... no
  …
  make check
  ```

  Fixes: #13758
  Alternative to #13789, which should work for all compilers.

  Guix Build (x86_64):
  ```bash
  1fe67be2fe83c79d3b01c1cd657bed09e573226bf283e335d052c65c08a8e085  guix-build-4349051dd474/output/aarch64-linux-gnu/SHA256SUMS.part
  92904614f8792595c30c38c8aadfcd64ded658d58146dbae529c7b66e975d72e  guix-build-4349051dd474/output/aarch64-linux-gnu/bitcoin-4349051dd474-aarch64-linux-gnu-debug.tar.gz
  0e6c1d12caf87d9359d42eea4b652f10e69ab15a18bd572214f22046b2a019f1  guix-build-4349051dd474/output/aarch64-linux-gnu/bitcoin-4349051dd474-aarch64-linux-gnu.tar.gz
  e1b7d9b65cf0233c13affd570a0b3247c806553d968188a79f87ce9aab4fee36  guix-build-4349051dd474/output/arm-linux-gnueabihf/SHA256SUMS.part
  a7e0e53c2b6a0d0dc47a0740e501b280f82640e43d59e43d24dc236e9e9d3b4e  guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf-debug.tar.gz
  1969980159033d1c9f73e199acb9f93ddbbbd1565ac717ac5a29b907b46aec9c  guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf.tar.gz
  a1d679c8a861dc7b0422505e172745157680392227724bdbb6efb83ab564dd61  guix-build-4349051dd474/output/arm64-apple-darwin/SHA256SUMS.part
  37441242a3b97e51087a1b5df953f0a3ecb57a9523713bae152ac8005427118a  guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.dmg
  e86757e6f4b92080ed6504c245787d801a8f3ade07e1ed4cb0d1fa7a0088430e  guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.tar.gz
  ba2405f0b4835a3cb82bba4b281f6ffef97eb402430b47588c7ac986a29c5ae3  guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin.tar.gz
  7a4675924f23b9a57c93077d4a00a3d87a3929269301f70709079ee2491d932a  guix-build-4349051dd474/output/dist-archive/bitcoin-4349051dd474.tar.gz
  4f45b1cd6a819fd1f0fe81ef2c3f3bbb6614c9cbeb2115bfd15ef0f8fb50da25  guix-build-4349051dd474/output/powerpc64-linux-gnu/SHA256SUMS.part
  262db5ffba4d952e0b3eb2a4f97a795058d58dbd280c48e7a389809c699c7465  guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu-debug.tar.gz
  0a230d352da964fb8bd101aa690a49604ecbfaf1756c8da9aad88635598b0102  guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu.tar.gz
  f155e0039b78bf772db8047b5d9eb4445e30b210f1bfa1d184e5587a06cdc583  guix-build-4349051dd474/output/powerpc64le-linux-gnu/SHA256SUMS.part
  6c32c429f5555cd5bab34a201352a3dae335f4bc23607996e170691c403db68f  guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu-debug.tar.gz
  0c0d4d37eb75a04a702e1c7116fa89fd5d03439a0c08fdbcbc2d5349e071037e  guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu.tar.gz
  bcc72b010ef0d53811d5b21e8b65a45ec861b0dc4658286c85b4eea3c5ef3264  guix-build-4349051dd474/output/riscv64-linux-gnu/SHA256SUMS.part
  c9740aa9daac4a57361b563525bd273851bc607544cfa196260f715794ebbc4b  guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu-debug.tar.gz
  049b1d9ef133fd5901bdbe1e77c5f11c43da4f3f8fca133c0be1dbfcddb6e900  guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu.tar.gz
  6d2ff63af68d5c6dd5709b3543e0ed59d2b6cd9c3b4f20fa873edb5a643ad929  guix-build-4349051dd474/output/x86_64-apple-darwin/SHA256SUMS.part
  6dc850bed29860fc23b183ddf9bcf17c6e6ad3917a220c13d617a3bcd16b5788  guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.dmg
  2ff9849c2cf8504e1bbedc5bdc2bb1a11f439df84a6c2cfcbf195025c11289e8  guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.tar.gz
  4d284659d6df5d3ead86d313fb5794552a83102f5c30fa433f32c87a2be25679  guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin.tar.gz
  029b5dacfe77e865263fe3f9f0c12d65bf0fcfed152812e50cabd085a4a12b14  guix-build-4349051dd474/output/x86_64-linux-gnu/SHA256SUMS.part
  3f8295482e9da6e5a3780a98ef9e58b0924f59f9e2ab76bc70e1dc9c8691a764  guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu-debug.tar.gz
  9dd5bb321c4bae36cfd8b6b23dd3df9462917c272bd36a7f562131db3a067d35  guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu.tar.gz
  632ad4f8d7c10f4eb8422e0ccb1ecf35c03260fe1eb91224b0ab3d18765960b7  guix-build-4349051dd474/output/x86_64-w64-mingw32/SHA256SUMS.part
  fb6609c3f74b676a67d2334c150094a1be5f5d6a41ae40edcb26b073ce3ad841  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-debug.zip
  706074270e189a6e9bd32e1b522fc0c5c9f3c076839db9cc983d171bb2f2dd4a  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-setup-unsigned.exe
  78ce8c104eb6496f76633c5ee3988965b8b687583c51d97957cf936e34e8c6ef  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-unsigned.tar.gz
  0db748e76cb4d414f81f8b538e4b0a79ab1281fb16e480fcada9935e2bfc709d  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  e1b7d9b65cf0233c13affd570a0b3247c806553d968188a79f87ce9aab4fee36  guix-build-4349051dd474/output/arm-linux-gnueabihf/SHA256SUMS.part
  a7e0e53c2b6a0d0dc47a0740e501b280f82640e43d59e43d24dc236e9e9d3b4e  guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf-debug.tar.gz
  1969980159033d1c9f73e199acb9f93ddbbbd1565ac717ac5a29b907b46aec9c  guix-build-4349051dd474/output/arm-linux-gnueabihf/bitcoin-4349051dd474-arm-linux-gnueabihf.tar.gz
  a1d679c8a861dc7b0422505e172745157680392227724bdbb6efb83ab564dd61  guix-build-4349051dd474/output/arm64-apple-darwin/SHA256SUMS.part
  37441242a3b97e51087a1b5df953f0a3ecb57a9523713bae152ac8005427118a  guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.dmg
  e86757e6f4b92080ed6504c245787d801a8f3ade07e1ed4cb0d1fa7a0088430e  guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin-unsigned.tar.gz
  ba2405f0b4835a3cb82bba4b281f6ffef97eb402430b47588c7ac986a29c5ae3  guix-build-4349051dd474/output/arm64-apple-darwin/bitcoin-4349051dd474-arm64-apple-darwin.tar.gz
  7a4675924f23b9a57c93077d4a00a3d87a3929269301f70709079ee2491d932a  guix-build-4349051dd474/output/dist-archive/bitcoin-4349051dd474.tar.gz
  4f45b1cd6a819fd1f0fe81ef2c3f3bbb6614c9cbeb2115bfd15ef0f8fb50da25  guix-build-4349051dd474/output/powerpc64-linux-gnu/SHA256SUMS.part
  262db5ffba4d952e0b3eb2a4f97a795058d58dbd280c48e7a389809c699c7465  guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu-debug.tar.gz
  0a230d352da964fb8bd101aa690a49604ecbfaf1756c8da9aad88635598b0102  guix-build-4349051dd474/output/powerpc64-linux-gnu/bitcoin-4349051dd474-powerpc64-linux-gnu.tar.gz
  f155e0039b78bf772db8047b5d9eb4445e30b210f1bfa1d184e5587a06cdc583  guix-build-4349051dd474/output/powerpc64le-linux-gnu/SHA256SUMS.part
  6c32c429f5555cd5bab34a201352a3dae335f4bc23607996e170691c403db68f  guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu-debug.tar.gz
  0c0d4d37eb75a04a702e1c7116fa89fd5d03439a0c08fdbcbc2d5349e071037e  guix-build-4349051dd474/output/powerpc64le-linux-gnu/bitcoin-4349051dd474-powerpc64le-linux-gnu.tar.gz
  bcc72b010ef0d53811d5b21e8b65a45ec861b0dc4658286c85b4eea3c5ef3264  guix-build-4349051dd474/output/riscv64-linux-gnu/SHA256SUMS.part
  c9740aa9daac4a57361b563525bd273851bc607544cfa196260f715794ebbc4b  guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu-debug.tar.gz
  049b1d9ef133fd5901bdbe1e77c5f11c43da4f3f8fca133c0be1dbfcddb6e900  guix-build-4349051dd474/output/riscv64-linux-gnu/bitcoin-4349051dd474-riscv64-linux-gnu.tar.gz
  6d2ff63af68d5c6dd5709b3543e0ed59d2b6cd9c3b4f20fa873edb5a643ad929  guix-build-4349051dd474/output/x86_64-apple-darwin/SHA256SUMS.part
  6dc850bed29860fc23b183ddf9bcf17c6e6ad3917a220c13d617a3bcd16b5788  guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.dmg
  2ff9849c2cf8504e1bbedc5bdc2bb1a11f439df84a6c2cfcbf195025c11289e8  guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin-unsigned.tar.gz
  4d284659d6df5d3ead86d313fb5794552a83102f5c30fa433f32c87a2be25679  guix-build-4349051dd474/output/x86_64-apple-darwin/bitcoin-4349051dd474-x86_64-apple-darwin.tar.gz
  029b5dacfe77e865263fe3f9f0c12d65bf0fcfed152812e50cabd085a4a12b14  guix-build-4349051dd474/output/x86_64-linux-gnu/SHA256SUMS.part
  3f8295482e9da6e5a3780a98ef9e58b0924f59f9e2ab76bc70e1dc9c8691a764  guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu-debug.tar.gz
  9dd5bb321c4bae36cfd8b6b23dd3df9462917c272bd36a7f562131db3a067d35  guix-build-4349051dd474/output/x86_64-linux-gnu/bitcoin-4349051dd474-x86_64-linux-gnu.tar.gz
  632ad4f8d7c10f4eb8422e0ccb1ecf35c03260fe1eb91224b0ab3d18765960b7  guix-build-4349051dd474/output/x86_64-w64-mingw32/SHA256SUMS.part
  fb6609c3f74b676a67d2334c150094a1be5f5d6a41ae40edcb26b073ce3ad841  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-debug.zip
  706074270e189a6e9bd32e1b522fc0c5c9f3c076839db9cc983d171bb2f2dd4a  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-setup-unsigned.exe
  78ce8c104eb6496f76633c5ee3988965b8b687583c51d97957cf936e34e8c6ef  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64-unsigned.tar.gz
  0db748e76cb4d414f81f8b538e4b0a79ab1281fb16e480fcada9935e2bfc709d  guix-build-4349051dd474/output/x86_64-w64-mingw32/bitcoin-4349051dd474-win64.zip
  ```

Top commit has no ACKs.

Tree-SHA512: 0970b0dd07f6e237f7e2fed770649cc82ef4c22c4d9603a51818c353928833546fc76a3de5054979428d7309c073ce3120dd4bfc621245ff4319e8ac9e321472
2022-08-19 10:30:36 +02:00
fanquake
ced00f5a2e
fs: work around u8path deprecated-declaration warnings with libc++
When building in c++20 mode using libc++, the following warning is
emitted:
```bash
./fs.h:72:29: warning: 'u8path<std::string>' is deprecated [-Wdeprecated-declarations]
    return std::filesystem::u8path(utf8_str);
                            ^
/usr/lib/llvm-14/bin/../include/c++/v1/__filesystem/u8path.h:72:27: note: 'u8path<std::string>' has been explicitly marked deprecated here
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
                          ^
/usr/lib/llvm-14/bin/../include/c++/v1/__config:1042:43: note: expanded from macro '_LIBCPP_DEPRECATED_WITH_CHAR8_T'
                                          ^
/usr/lib/llvm-14/bin/../include/c++/v1/__config:1007:48: note: expanded from macro '_LIBCPP_DEPRECATED'
                                               ^
1 warning generated.
```

as u8path<std::string> is deprecated starting with c++20.

Fixes: #24682.

Co-authored-by: MacroFake <falke.marco@gmail.com>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-08-19 08:58:56 +01:00
fanquake
0425ce577f
Merge bitcoin/bitcoin#25679: wallet: Correctly identify external inputs that are also in the wallet
ef8e2a5b09 tests: Test that external inputs of txs in wallet is handled correctly (Andrew Chow)
eb879634db wallet: Try estimating input size with external data if wallet fails (Andrew Chow)
a537d7aaa0 wallet: SelectExternal actually external inputs (Andrew Chow)
f2d00bfe1a wallet: Add CWallet::IsMine(COutPoint) (Andrew Chow)

Pull request description:

  if a transaction is being funded that has an external input, and that input's parent is also in the wallet, we will fail to detect that and fail to fund the transaction. In order to correctly detect such inputs, we need to be doing `IsMine` on all specified inputs in order to use `Select` and `SelectExternal` correctly. Additionally `SelectCoins` needs to call `CalculateMaximumSignedInputSize` with the correct parameters which depends on whether the wallet is able to solve for the input. Because there are some situations where the wallet could find an external input to belong to it (e.g. watching an address - unable to solve, but will be ISMINE_WATCHONLY), instead of switching which `CalculateMaximumSignedInputSize` to use, we should call the one that uses the wallet, and if that fails, try again with the one that uses external solving data.

  Also adds a test for this case.

ACKs for top commit:
  instagibbs:
    ACK ef8e2a5b09
  furszy:
    ACK ef8e2a5b
  ishaanam:
    reACK ef8e2a5b09

Tree-SHA512: a43c4aefeed4605f33a36ce87ebb916e2c153fea6d415b02c9a89275e84a7e3bf12840b33c296d2d2bde46350390da48d9262f9567338e3f21d5936aae4caa1e
2022-08-19 08:53:44 +01:00
Andrew Chow
888628cee0
Merge bitcoin/bitcoin#25827: descriptor: check if rawtr has only one key.
416ceb8661 descriptor: check if `rawtr` has only one key. (w0xlt)

Pull request description:

  If I understand `rawtr` descriptor correctly, it should only allow `rawtr(KEY)`, not `rawtr(KEY1, KEY2, ...)` or other concatenations.

  On master branch, `rawtr(KEY1, KEY2, ...)` will produce the `rawtr(KEY1)` descriptor ignoring the `KEY2, ...` with no error messages or warnings.

  For example, the code below will print `rawtr(tprv8ZgxMBicQKsPefef2Doobbq3xTCaVTHcDn6me82KSXY1vY9AJAWD5u7SDM4XGLfc4EoXRMFrJKpp6HNmQWA3FTMRQeEmMJYJ9RPqe9ne2hU/*)#lx9qryfh`
  for the supposedly invalid descriptor
  `rawtr(tprv8ZgxMBicQKsPefef2Doobbq3xTCaVTHcDn6me82KSXY1vY9AJAWD5u7SDM4XGLfc4EoXRMFrJKpp6HNmQWA3FTMRQeEmMJYJ9RPqe9ne2hU/*, tprv8ZgxMBicQKsPezQ2KGArMRovTEbCGxaLgBgaVcTvEx8mby8ogX2bgC4HBapH4yMwrz2FpoCuA17eocuUVMgEP6fnm83YpwSDTFrumw42bny/*)`
  ```python
          self.nodes[1].createwallet(wallet_name="rawtr_multi", descriptors=True, blank=True)
          rawtr_multi = self.nodes[1].get_wallet_rpc("rawtr_multi")
          rawtr_multi_desc = "rawtr(tprv8ZgxMBicQKsPefef2Doobbq3xTCaVTHcDn6me82KSXY1vY9AJAWD5u7SDM4XGLfc4EoXRMFrJKpp6HNmQWA3FTMRQeEmMJYJ9RPqe9ne2hU/*, tprv8ZgxMBicQKsPezQ2KGArMRovTEbCGxaLgBgaVcTvEx8mby8ogX2bgC4HBapH4yMwrz2FpoCuA17eocuUVMgEP6fnm83YpwSDTFrumw42bny/*)#uv78hkt0"
          result = rawtr_multi.importdescriptors([{"desc": rawtr_multi_desc, "active": True, "timestamp": "now"}])

          print(rawtr_multi.listdescriptors(True))
  ```

  This PR adds a check that prevents `rawtr` descriptors from being created if more than one key is entered, shows an error message, and adds a test for this case.

ACKs for top commit:
  achow101:
    ACK 416ceb8661
  sipa:
    ACK 416ceb8661

Tree-SHA512: a2009e91f1bca6ee79cc68f65811caa6a21fc8b80acd8dc58e283f424b41fe53b0db7ce3693b1c7e2184ff571e6d1fbb9f5ccde89b65d3026726f3393c492044
2022-08-18 16:50:43 -04:00
furszy
5b4fdbbff5
wallet: remove UNKNOWN type from OUTPUT_TYPES array
This array contains the known active output types only.
And it's solely used to create/walk-through the active spkms.
2022-08-18 16:47:15 -03:00
Andrew Chow
ef8e2a5b09 tests: Test that external inputs of txs in wallet is handled correctly 2022-08-18 11:07:22 -04:00
Andrew Chow
eb879634db wallet: Try estimating input size with external data if wallet fails
Instead of choosing whether to use the wallet or external data when
estimating the size of an input, first use the wallet, then try external
data if that failed.
2022-08-18 11:00:13 -04:00
Andrew Chow
a537d7aaa0 wallet: SelectExternal actually external inputs
If an external input's utxo was created by a transaction that the wallet
knows about, then it would not be selected using SelectExternal. This
results in either funding failure or incorrect weight calculation.
2022-08-18 11:00:12 -04:00
Jon Atack
f1379aeca9 Simplify BCLog::Level enum class and LogLevelToStr() function
- simplify the BCLog::Level enum class (and future changes to it) by
  only setting the value of the first enumerator

- move the BCLog::Level:None enumerator to the end of the BCLog::Level
  enum class and LogLevelToStr() member function, as the None enumerator
  is only used internally, and by being the highest BCLog::Level value it
  can be used to iterate over the enumerators

- replace the unused BCLog::Level:None string "none" with an empty string
  as the case will never be hit

- add documentation
2022-08-18 16:32:43 +02:00
Sebastian Falbesoner
b21e522ce4 test: speedup wallet tests by whitelisting peers (immediate tx relay) 2022-08-18 00:15:21 +02:00
Andrew Chow
a8f69541ad
Merge bitcoin/bitcoin#25748: refactor: Avoid copies in FlatSigningProvider Merge
fa3f15f2dd refactor: Avoid copies in FlatSigningProvider Merge (MacroFake)

Pull request description:

  `Merge` will create several copies unconditionally:
  * To initialize the args `a`, and `b`
  * `ret`, which is the merge of the two args

  So change the code to let the caller decide how many copies they need/want:
  * `a`, and `b` must be explicitly moved or copied by the caller
  * `ret` is no longer needed, as `a` can be used for it in place "for free"

ACKs for top commit:
  achow101:
    ACK fa3f15f2dd
  furszy:
    looks good, ACK fa3f15f2
  ryanofsky:
    Code review ACK fa3f15f2dd. Confirmed that all the places `std::move` was added the argument actually did seem safe to move from. Compiler enforces that temporary copies are explicitly created in non-move cases.

Tree-SHA512: 7c027ccdea1549cd9f37403344ecbb76e008adf545f6ce52996bf95e89eb7dc89af6cb31435a9289d6f2eea1c416961b2fb96348bc8a211d550728f1d99ac49c
2022-08-17 17:57:33 -04:00
w0xlt
416ceb8661 descriptor: check if rawtr has only one key. 2022-08-17 13:54:51 -03:00
fanquake
a75b7796b7
Merge bitcoin/bitcoin#25077: Fix chain tip data race and corrupt rest response
fac04cb6ba refactor: Add lock annotations to Active* methods (MacroFake)
fac15ff673 Fix logical race in rest_getutxos (MacroFake)
fa97a528d6 Fix UB/data-race in RPCNotifyBlockChange (MacroFake)
fa530bcb9c Add ChainstateManager::GetMutex(), an alias for ::cs_main (MacroFake)

Pull request description:

  This fixes two issues:

  * A data race in `ActiveChain`, which returns a reference to the chain (a `std::vector`), which is not thread safe. See also below traceback.
  * A corrupt rest response, which returns a blockheight and blockhash, which are unrelated to each other and to the result, as the chain might advance between each call without cs_main held.

  The issues are fixed by taking cs_main and holding it for the required time.

  ```
  ==================
  WARNING: ThreadSanitizer: data race (pid=32335)
    Write of size 8 at 0x7b3c000008f0 by thread T22 (mutexes: write M131626, write M151, write M131553):
      #0 std::__1::enable_if<(is_move_constructible<CBlockIndex**>::value) && (is_move_assignable<CBlockIndex**>::value), void>::type std::__1::swap<CBlockIndex**>(CBlockIndex**&, CBlockIndex**&) /usr/lib/llvm-13/bin/../include/c++/v1/__utility/swap.h:39:7 (bitcoind+0x501239)
      #1 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::__swap_out_circular_buffer(std::__1::__split_buffer<CBlockIndex*, std::__1::allocator<CBlockIndex*>&>&) /usr/lib/llvm-13/bin/../include/c++/v1/vector:977:5 (bitcoind+0x501239)
      #2 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::__append(unsigned long) /usr/lib/llvm-13/bin/../include/c++/v1/vector:1117:9 (bitcoind+0x501239)
      #3 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::resize(unsigned long) /usr/lib/llvm-13/bin/../include/c++/v1/vector:2046:15 (bitcoind+0x4ffe29)
      #4 CChain::SetTip(CBlockIndex*) src/chain.cpp:19:12 (bitcoind+0x4ffe29)
      #5 CChainState::ConnectTip(BlockValidationState&, CBlockIndex*, std::__1::shared_ptr<CBlock const> const&, ConnectTrace&, DisconnectedBlockTransactions&) src/validation.cpp:2748:13 (bitcoind+0x475d00)
      #6 CChainState::ActivateBestChainStep(BlockValidationState&, CBlockIndex*, std::__1::shared_ptr<CBlock const> const&, bool&, ConnectTrace&) src/validation.cpp:2884:18 (bitcoind+0x47739e)
      #7 CChainState::ActivateBestChain(BlockValidationState&, std::__1::shared_ptr<CBlock const>) src/validation.cpp:3011:22 (bitcoind+0x477baf)
      #8 node::ThreadImport(ChainstateManager&, std::__1::vector<fs::path, std::__1::allocator<fs::path> >, ArgsManager const&) src/node/blockstorage.cpp:883:30 (bitcoind+0x23cd74)
      #9 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7::operator()() const src/init.cpp:1657:9 (bitcoind+0x15863e)
      #10 decltype(static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(fp)()) std::__1::__invoke<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x15863e)
      #11 void std::__1::__invoke_void_return_wrapper<void, true>::__call<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/__functional/invoke.h:61:9 (bitcoind+0x15863e)
      #12 std::__1::__function::__alloc_func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:171:16 (bitcoind+0x15863e)
      #13 std::__1::__function::__func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:345:12 (bitcoind+0x15863e)
      #14 std::__1::__function::__value_func<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:498:16 (bitcoind+0x88891f)
      #15 std::__1::function<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:1175:12 (bitcoind+0x88891f)
      #16 util::TraceThread(char const*, std::__1::function<void ()>) src/util/thread.cpp:18:9 (bitcoind+0x88891f)
      #17 decltype(static_cast<void (*>(fp)(static_cast<char const*>(fp0), static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(fp0))) std::__1::__invoke<void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(void (*&&)(char const*, std::__1::function<void ()>), char const*&&, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x157e6a)
      #18 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-13/bin/../include/c++/v1/thread:280:5 (bitcoind+0x157e6a)
      #19 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7> >(void*) /usr/lib/llvm-13/bin/../include/c++/v1/thread:291:5 (bitcoind+0x157e6a)
    Previous read of size 8 at 0x7b3c000008f0 by main thread:
      #0 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::size() const /usr/lib/llvm-13/bin/../include/c++/v1/vector:680:61 (bitcoind+0x15179d)
      #1 CChain::Tip() const src/./chain.h:449:23 (bitcoind+0x15179d)
      #2 ChainstateManager::ActiveTip() const src/./validation.h:927:59 (bitcoind+0x15179d)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1841:35 (bitcoind+0x15179d)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
    Location is heap block of size 232 at 0x7b3c00000870 allocated by main thread:
      #0 operator new(unsigned long) <null> (bitcoind+0x132668)
      #1 ChainstateManager::InitializeChainstate(CTxMemPool*, std::__1::optional<uint256> const&) src/validation.cpp:4851:21 (bitcoind+0x48e26b)
      #2 node::LoadChainstate(bool, ChainstateManager&, CTxMemPool*, bool, Consensus::Params const&, bool, long, long, long, bool, bool, std::__1::function<bool ()>, std::__1::function<void ()>) src/node/chainstate.cpp:31:14 (bitcoind+0x24de07)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1438:32 (bitcoind+0x14e994)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
    Mutex M131626 (0x7b3c00000898) created at:
      #0 pthread_mutex_lock <null> (bitcoind+0xda898)
      #1 std::__1::mutex::lock() <null> (libc++.so.1+0x49f35)
      #2 node::ThreadImport(ChainstateManager&, std::__1::vector<fs::path, std::__1::allocator<fs::path> >, ArgsManager const&) src/node/blockstorage.cpp:883:30 (bitcoind+0x23cd74)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7::operator()() const src/init.cpp:1657:9 (bitcoind+0x15863e)
      #4 decltype(static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(fp)()) std::__1::__invoke<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x15863e)
      #5 void std::__1::__invoke_void_return_wrapper<void, true>::__call<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/__functional/invoke.h:61:9 (bitcoind+0x15863e)
      #6 std::__1::__function::__alloc_func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:171:16 (bitcoind+0x15863e)
      #7 std::__1::__function::__func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:345:12 (bitcoind+0x15863e)
      #8 std::__1::__function::__value_func<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:498:16 (bitcoind+0x88891f)
      #9 std::__1::function<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:1175:12 (bitcoind+0x88891f)
      #10 util::TraceThread(char const*, std::__1::function<void ()>) src/util/thread.cpp:18:9 (bitcoind+0x88891f)
      #11 decltype(static_cast<void (*>(fp)(static_cast<char const*>(fp0), static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(fp0))) std::__1::__invoke<void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(void (*&&)(char const*, std::__1::function<void ()>), char const*&&, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x157e6a)
      #12 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-13/bin/../include/c++/v1/thread:280:5 (bitcoind+0x157e6a)
      #13 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7> >(void*) /usr/lib/llvm-13/bin/../include/c++/v1/thread:291:5 (bitcoind+0x157e6a)
    Mutex M151 (0x55aacb8ea030) created at:
      #0 pthread_mutex_init <null> (bitcoind+0xbed2f)
      #1 std::__1::recursive_mutex::recursive_mutex() <null> (libc++.so.1+0x49fb3)
      #2 __libc_start_main <null> (libc.so.6+0x29eba)
    Mutex M131553 (0x7b4c000042e0) created at:
      #0 pthread_mutex_init <null> (bitcoind+0xbed2f)
      #1 std::__1::recursive_mutex::recursive_mutex() <null> (libc++.so.1+0x49fb3)
      #2 std::__1::__unique_if<CTxMemPool>::__unique_single std::__1::make_unique<CTxMemPool, CBlockPolicyEstimator*, int const&>(CBlockPolicyEstimator*&&, int const&) /usr/lib/llvm-13/bin/../include/c++/v1/__memory/unique_ptr.h:728:32 (bitcoind+0x15c81d)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1426:24 (bitcoind+0x14e7b4)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
    Thread T22 'b-loadblk' (tid=32370, running) created by main thread at:
      #0 pthread_create <null> (bitcoind+0xbd5bd)
      #1 std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /usr/lib/llvm-13/bin/../include/c++/v1/__threading_support:443:10 (bitcoind+0x155e06)
      #2 std::__1:🧵:thread<void (*)(char const*, std::__1::function<void ()>), char const (&) [8], AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, void>(void (*&&)(char const*, std::__1::function<void ()>), char const (&) [8], AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&&) /usr/lib/llvm-13/bin/../include/c++/v1/thread:307:16 (bitcoind+0x155e06)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1656:29 (bitcoind+0x150164)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
  SUMMARY: ThreadSanitizer: data race /usr/lib/llvm-13/bin/../include/c++/v1/__utility/swap.h:39:7 in std::__1::enable_if<(is_move_constructible<CBlockIndex**>::value) && (is_move_assignable<CBlockIndex**>::value), void>::type std::__1::swap<CBlockIndex**>(CBlockIndex**&, CBlockIndex**&)
  ==================
  ```

  From https://cirrus-ci.com/task/5612886578954240?logs=ci#L4868

ACKs for top commit:
  achow101:
    re-ACK fac04cb6ba
  theStack:
    Code-review ACK fac04cb6ba

Tree-SHA512: 9d619f99ff6373874c7ffe1db20674575605646b4b54b692fb54515a4a49f110a770026d7320ed6dfeaa7976be4cd89e93f821acdbf22c7662bd1c5be0cedcd2
2022-08-17 15:04:14 +01:00
fanquake
aa774f3e11
Merge bitcoin/bitcoin#25829: build: include share/rpcauth in release tarball
495caa9a01 build: add example bitcoin conf to win installer (fanquake)
0eac1f7ba4 build: include share/rpcauth in tarball & installer (fanquake)

Pull request description:

  Fixes #19081.
  Addresses: https://github.com/bitcoin/bitcoin/pull/22235#discussion_r946359661.

  Guix Build (x86_64):
  ```bash
  bdc14efe02553703f3f27438b17ee452fc0b08e37f626830857c60a7740ec990  guix-build-495caa9a0149/output/aarch64-linux-gnu/SHA256SUMS.part
  0c541efd8e2e52f1915cab13c935f165f906e46590175d568be34e026b5f0d9e  guix-build-495caa9a0149/output/aarch64-linux-gnu/bitcoin-495caa9a0149-aarch64-linux-gnu-debug.tar.gz
  5ee15e11e0d52d5a2df6b6a60e4ae5b3adc4b259294ad53452478f28efbe70c8  guix-build-495caa9a0149/output/aarch64-linux-gnu/bitcoin-495caa9a0149-aarch64-linux-gnu.tar.gz
  451152a282fd79db45a09e0ccb3491e3044ea5ad0931dfe2820bb5c45839a311  guix-build-495caa9a0149/output/arm-linux-gnueabihf/SHA256SUMS.part
  b88159ac78d427556e7f70e5da3b849da5491c98fa08c16c25adbfa8e3b44b58  guix-build-495caa9a0149/output/arm-linux-gnueabihf/bitcoin-495caa9a0149-arm-linux-gnueabihf-debug.tar.gz
  54b59e4d06144d18b97a0260330383dafdcf3473b560c71f6304a8d1b9ef0100  guix-build-495caa9a0149/output/arm-linux-gnueabihf/bitcoin-495caa9a0149-arm-linux-gnueabihf.tar.gz
  784f43a651ed6f9335117ca971c7c215eba536414792edf72a0dc372c901c3fa  guix-build-495caa9a0149/output/arm64-apple-darwin/SHA256SUMS.part
  ace525b20dc4789c931cf781027680e5fe35bd987c8d1908590cd83ce7e44495  guix-build-495caa9a0149/output/arm64-apple-darwin/bitcoin-495caa9a0149-arm64-apple-darwin-unsigned.dmg
  1ab6d5d91040567e4fccb4e2de49789f78bd1ce9b4a496486d837904591bfbc6  guix-build-495caa9a0149/output/arm64-apple-darwin/bitcoin-495caa9a0149-arm64-apple-darwin-unsigned.tar.gz
  a5cd681e67beda05cac83d133d6996699effb12b9830b269669057d02b0a4eef  guix-build-495caa9a0149/output/arm64-apple-darwin/bitcoin-495caa9a0149-arm64-apple-darwin.tar.gz
  01cc3a078a952ed9bbff38e79bad4885a5f8502906498f7b909cb2cc798ada64  guix-build-495caa9a0149/output/dist-archive/bitcoin-495caa9a0149.tar.gz
  d4652f912573d0c9ce11d7e84fad10ad03f67247f85b0a5d9c47db74508705ce  guix-build-495caa9a0149/output/powerpc64-linux-gnu/SHA256SUMS.part
  76facbb81819b2d81afd61e2234b65d99c9e28b28f2b1d3ee2d7119cf192ba60  guix-build-495caa9a0149/output/powerpc64-linux-gnu/bitcoin-495caa9a0149-powerpc64-linux-gnu-debug.tar.gz
  a75cef05abb05da4a1ba81669f6a66ecc790946b6b2fd3749bad0b462bb50219  guix-build-495caa9a0149/output/powerpc64-linux-gnu/bitcoin-495caa9a0149-powerpc64-linux-gnu.tar.gz
  2b2ac79848a643f025960cabca2694cb3537d72d83477ed1b53bcc6e2ee11ce4  guix-build-495caa9a0149/output/powerpc64le-linux-gnu/SHA256SUMS.part
  d0542623109fb72d72dcd06f8de30edefdd7e0f1bf46a7be7c262c0e631c49d8  guix-build-495caa9a0149/output/powerpc64le-linux-gnu/bitcoin-495caa9a0149-powerpc64le-linux-gnu-debug.tar.gz
  b85dbcbe4f50cbddcd167568d31326d62e786720cb237aaf3d11b69394f01983  guix-build-495caa9a0149/output/powerpc64le-linux-gnu/bitcoin-495caa9a0149-powerpc64le-linux-gnu.tar.gz
  a85a00d353338d2e72a4218782e05a816f21aea0637eb21742c55ee9a9ce1f7b  guix-build-495caa9a0149/output/riscv64-linux-gnu/SHA256SUMS.part
  e10561b08a91a22947ead27b6d4a07581fa566eb3e5d8161f97b2ff2708b85f4  guix-build-495caa9a0149/output/riscv64-linux-gnu/bitcoin-495caa9a0149-riscv64-linux-gnu-debug.tar.gz
  994aca800c2580349a436fb1fa8195cd943363dee5c3ee7c91d726cc95cd3068  guix-build-495caa9a0149/output/riscv64-linux-gnu/bitcoin-495caa9a0149-riscv64-linux-gnu.tar.gz
  5a063e6dbf64aca4a639fea10fcff2f7a533819607558cec25a9a88bc575c0dc  guix-build-495caa9a0149/output/x86_64-apple-darwin/SHA256SUMS.part
  e7f36749c3a48ce7173ee100abb275eb217eee2713d52d8b576f8c749e0c2e9e  guix-build-495caa9a0149/output/x86_64-apple-darwin/bitcoin-495caa9a0149-x86_64-apple-darwin-unsigned.dmg
  b0289c6caba5e092d8e287c9cb4f328844bce04fce74de91e76821423b7b8153  guix-build-495caa9a0149/output/x86_64-apple-darwin/bitcoin-495caa9a0149-x86_64-apple-darwin-unsigned.tar.gz
  2bf983abcfd0d782632ef7fb116ba169a0b282264774c032a50beca016468ed0  guix-build-495caa9a0149/output/x86_64-apple-darwin/bitcoin-495caa9a0149-x86_64-apple-darwin.tar.gz
  72705350ab34f8d33ef98e5563f36aa82f15e7b450e3914f591b9c88e8b385da  guix-build-495caa9a0149/output/x86_64-linux-gnu/SHA256SUMS.part
  7b5285bfd28acf8ae1471807962d31857afe70e13ae087a8aec83d5a8ac1a184  guix-build-495caa9a0149/output/x86_64-linux-gnu/bitcoin-495caa9a0149-x86_64-linux-gnu-debug.tar.gz
  6544591754607792b731fe630bf8235e78e08c7edb4d1d210b35d6328240acc1  guix-build-495caa9a0149/output/x86_64-linux-gnu/bitcoin-495caa9a0149-x86_64-linux-gnu.tar.gz
  bbd6490489ddfde06b6cde602d317d84c09495de3cf033016ea0ba5e60770fdb  guix-build-495caa9a0149/output/x86_64-w64-mingw32/SHA256SUMS.part
  f48f6efcf5822517a697d990eddbc03011b08c5e4be4886e25ab65c8a0951aaa  guix-build-495caa9a0149/output/x86_64-w64-mingw32/bitcoin-495caa9a0149-win64-debug.zip
  b1a83e58d7b316c4743ae16d552f615aa710a4985ded5834d1de6fe6437ca3b2  guix-build-495caa9a0149/output/x86_64-w64-mingw32/bitcoin-495caa9a0149-win64-setup-unsigned.exe
  0196abf8cb27f3cb03b4688a85a97c26975db4938f7a2dc0a09f11847f6530bb  guix-build-495caa9a0149/output/x86_64-w64-mingw32/bitcoin-495caa9a0149-win64-unsigned.tar.gz
  426994640e85f82b3d3bee25f07930f952edf4a60ecd7ba41f83c82cbbcc63d1  guix-build-495caa9a0149/output/x86_64-w64-mingw32/bitcoin-495caa9a0149-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  506a2fade794398ec38cf9c59ca0b454fdcbb0080d7e40f1ace698a7b08eef77  guix-build-cf39913e5748/output/arm-linux-gnueabihf/SHA256SUMS.part
  8ec3686ba80709eb024ea02b7b493e70af82383d814b105f157c94a86cb7efd6  guix-build-cf39913e5748/output/arm-linux-gnueabihf/bitcoin-cf39913e5748-arm-linux-gnueabihf-debug.tar.gz
  4d9b3456c974f7f47dca64bcc994fa04888bf08518c902d12366798829a9100d  guix-build-cf39913e5748/output/arm-linux-gnueabihf/bitcoin-cf39913e5748-arm-linux-gnueabihf.tar.gz
  7c74610dcaa1dbb7fcadb2ad59520fdfa3fa02f26ceb88ada178ac35a0644840  guix-build-cf39913e5748/output/arm64-apple-darwin/SHA256SUMS.part
  fca59c367d2b5891186c546bd87ed66dcc4f0b11433b54c49ad72aa5e0e49978  guix-build-cf39913e5748/output/arm64-apple-darwin/bitcoin-cf39913e5748-arm64-apple-darwin-unsigned.dmg
  467e5c2eeaccac995d14b41f5418ba783b31ee7c63d76d5fce5e667bd6ef6683  guix-build-cf39913e5748/output/arm64-apple-darwin/bitcoin-cf39913e5748-arm64-apple-darwin-unsigned.tar.gz
  1f19caa059cd6b4adcc089f90ce33fe7f679b3a4beb970b3ef5c3292fe5841ee  guix-build-cf39913e5748/output/arm64-apple-darwin/bitcoin-cf39913e5748-arm64-apple-darwin.tar.gz
  ea07945bf21cbe306e8afc815ccb5f4a363fb7335239fe35b3668bdef43f735a  guix-build-cf39913e5748/output/dist-archive/bitcoin-cf39913e5748.tar.gz
  b699ae65b899192ad5afbe6a069d2113fda92b833f7db31a1487e7c4c04440f5  guix-build-cf39913e5748/output/powerpc64-linux-gnu/SHA256SUMS.part
  eeced64cd3e49ecd95ec29623f7cd3afe66ceffb8296af646ee4e1f3fe658ab0  guix-build-cf39913e5748/output/powerpc64-linux-gnu/bitcoin-cf39913e5748-powerpc64-linux-gnu-debug.tar.gz
  20181015752a5d7bfc0d173fefb554b785ca0e566ffef443da6673d6a63ef10d  guix-build-cf39913e5748/output/powerpc64-linux-gnu/bitcoin-cf39913e5748-powerpc64-linux-gnu.tar.gz
  59338187f551f1c043e80f63c897899365fca4872b4d793e71423c1aa7ff1358  guix-build-cf39913e5748/output/powerpc64le-linux-gnu/SHA256SUMS.part
  33d5d3113f176da881df06f5121d6003ae7f4e2d8124da805db1edab39161e81  guix-build-cf39913e5748/output/powerpc64le-linux-gnu/bitcoin-cf39913e5748-powerpc64le-linux-gnu-debug.tar.gz
  b5e9d3bf3e02aa6e3419c9f35118cb71323e0e01280b907e48fc335f8981cb6d  guix-build-cf39913e5748/output/powerpc64le-linux-gnu/bitcoin-cf39913e5748-powerpc64le-linux-gnu.tar.gz
  ef5d9f2449ad570221209194af4c4824fc70cfacbaa020da24b9186212b81c5f  guix-build-cf39913e5748/output/riscv64-linux-gnu/SHA256SUMS.part
  aafee42808b8bb2cdccbd919470bee2a1c9fcbb05daea32d15aa56288db7fc09  guix-build-cf39913e5748/output/riscv64-linux-gnu/bitcoin-cf39913e5748-riscv64-linux-gnu-debug.tar.gz
  72e2f3c9a48f8f3f14ecac2e6a8645253a32bfad8a857d13824aedd1796cad6f  guix-build-cf39913e5748/output/riscv64-linux-gnu/bitcoin-cf39913e5748-riscv64-linux-gnu.tar.gz
  8637b4e85eb2d7be803e813fbf15ee597aa35c9910b4b413d657fa69c4d4569d  guix-build-cf39913e5748/output/x86_64-apple-darwin/SHA256SUMS.part
  7b384d2734bfd650f3f8096aa32b2aa6bddfee137c3e27ac75736989f7e6740e  guix-build-cf39913e5748/output/x86_64-apple-darwin/bitcoin-cf39913e5748-x86_64-apple-darwin-unsigned.dmg
  06960637c9322c3b97bb58331b3282e770b02b7b4d95100866a96c31400a9bb9  guix-build-cf39913e5748/output/x86_64-apple-darwin/bitcoin-cf39913e5748-x86_64-apple-darwin-unsigned.tar.gz
  cc524e73d9441fc0e396c6ae5847d9b395d27f8bfe65703520792ea509191e2e  guix-build-cf39913e5748/output/x86_64-apple-darwin/bitcoin-cf39913e5748-x86_64-apple-darwin.tar.gz
  d99a7a48aa3a226d7f87c26dd4d6f12109e71fcb9f41052c0bcf5ba4bad1c408  guix-build-cf39913e5748/output/x86_64-linux-gnu/SHA256SUMS.part
  f2598fedf273244499f9481253f5114db2e299e132f5378c312f684d0a190f5f  guix-build-cf39913e5748/output/x86_64-linux-gnu/bitcoin-cf39913e5748-x86_64-linux-gnu-debug.tar.gz
  2151744dae55c460ad0c919101fcb845872060eef957d3ae0672f12098fa87b0  guix-build-cf39913e5748/output/x86_64-linux-gnu/bitcoin-cf39913e5748-x86_64-linux-gnu.tar.gz
  6087d880cced5f30d9b70b592c91efc5677f470f82cc9ed00e0fc112ff36ac43  guix-build-cf39913e5748/output/x86_64-w64-mingw32/SHA256SUMS.part
  e91e48edb8819cd25b6d6b5f5421473c56859dbb17cf32108e906877097d454d  guix-build-cf39913e5748/output/x86_64-w64-mingw32/bitcoin-cf39913e5748-win64-debug.zip
  ee4987cb94dcf4b5dfee65341a7a4f7b0865f1466c715c033a05591a749d43c3  guix-build-cf39913e5748/output/x86_64-w64-mingw32/bitcoin-cf39913e5748-win64-setup-unsigned.exe
  43001b416664ea227d3f07100d8a60bcd20c761770a332374a1466d7af734127  guix-build-cf39913e5748/output/x86_64-w64-mingw32/bitcoin-cf39913e5748-win64-unsigned.tar.gz
  bb9a56856800e7d6e5c602302ec90704cb5dd917f52d122d783deee3ab1f149d  guix-build-cf39913e5748/output/x86_64-w64-mingw32/bitcoin-cf39913e5748-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 495caa9a01, tested `bitcoin-495caa9a0149-win64-setup-unsigned.exe` on Windows 11 Pro:
  josibake:
    ACK 495caa9a01

Tree-SHA512: aca9101aec9b517defc915c213af7c2fec0c254c13374e13bff715e1ee771a20fc1b487457d48809af0b82321c0be8c23c5e02444fadfca53bc6bfe16c0f4239
2022-08-17 14:51:15 +01:00
fanquake
0ae0aa251b
Merge bitcoin/bitcoin#24678: Prevent wallet unload on GetWalletForJSONRPCRequest
f59959e381 wallet: Prevent wallet unload on GetWalletForJSONRPCRequest (João Barbosa)

Pull request description:

  Don't extend shared ownership of all wallets to `GetWalletForJSONRPCRequest` scope.

ACKs for top commit:
  achow101:
    ACK f59959e381
  shaavan:
    Code Review ACK f59959e381
  theStack:
    Concept and code-review ACK f59959e381

Tree-SHA512: 7c0294098b5c32acaab8cc6fcf17a581d580ad1a557ba0602a9506074ac035815739afb4a25b3e61be9132535c7fc3ec7ef5137c1dfc9d4078f13663d508ef55
2022-08-17 14:39:50 +01:00
fanquake
95d4744f02
Merge bitcoin/bitcoin#19391: RPC/Mining: Clean out pre-Segwit miner compatibility code
90a5dfa509 RPC/Mining: Clean out pre-Segwit miner compatibility code (Luke Dashjr)

Pull request description:

  This is dead code post-Segwit.

ACKs for top commit:
  achow101:
    ACK 90a5dfa509

Tree-SHA512: 5970aa3548d2a7da7c6e83fb9b910529faab10251b115122cec833bb7d3a54c7cb0714c1a873807be04c7817bb827c7ece1e20e8fa4c907aa58688487d0ec44d
2022-08-17 14:07:41 +01:00
Andrew Chow
f2d00bfe1a wallet: Add CWallet::IsMine(COutPoint)
It is useful to have an IsMine function that can take an outpoint.
2022-08-16 20:17:01 -04:00
Andrew Chow
64f7a1940d
Merge bitcoin/bitcoin#25734: wallet, refactor: #24584 follow-ups
8cd21bb279 refactor: improve readability for AttemptSelection (josibake)
f47ff71761 test: only run test for descriptor wallets (josibake)
0760ce0b9e test: add missing BOOST_ASSERT (josibake)
db09aec937 wallet: switch to new shuffle, erase, push_back (josibake)
b6b50b0f2b scripted-diff: Uppercase function names (josibake)
3f27a2adce refactor: add new helper methods (josibake)
f5649db9d5 refactor: add UNKNOWN OutputType (josibake)

Pull request description:

  This PR is to address follow-ups for #24584, specifically:

  * Remove redundant, hard-to-read code by adding a new `OutputType` and adding shuffle, erase, and push_back methods for `CoinsResult`
  * Add missing `BOOST_ASSERT` to unit test
  * Ensure functional test only runs if using descriptor wallets
  * Improve readability of `AttemptSelection` by removing triple-nested if statement

  Note for reviewers: commit `refactor: add new helper methods` should throw an "unused function warning"; the function is used in the next commit. Also, commit `wallet: switch to new shuffle, erase, push_back` will fail to compile, but this is fixed in the next commit with a scripted-diff. the commits are separate like this (code change then scripted-diff) to improve legibility.

ACKs for top commit:
  achow101:
    ACK 8cd21bb279
  aureleoules:
    ACK 8cd21bb279.
  LarryRuane:
    Concept, code review ACK 8cd21bb279
  furszy:
    utACK 8cd21bb2. Left a small, non-blocking, comment.

Tree-SHA512: a1bbc5962833e3df4f01a4895d8bd748cc4c608c3f296fd94e8afd8797b8d2e94e7bd44d598bd76fa5c9f5536864f396fcd097348fa0bb190a49a86b0917d60e
2022-08-16 20:00:19 -04:00
Andrew Chow
c336f813b3
Merge bitcoin/bitcoin#25504: RPC: allow to track coins by parent descriptors
a6b0c1fcc0 doc: add releases notes for 25504 (listsinceblock updates) (Antoine Poinsot)
0fd2d14454 rpc: add an include_change parameter to listsinceblock (Antoine Poinsot)
55f98d087e rpc: output parent wallet descriptors for coins in listunspent (Antoine Poinsot)
b724476158 rpc: output wallet descriptors for received entries in listsinceblock (Antoine Poinsot)
55a82eaf91 wallet: allow to fetch the wallet descriptors for a given Script (Antoine Poinsot)

Pull request description:

  Wallet descriptors are useful for applications using the Bitcoin Core wallet as a backend for tracking coins, as they allow to track coins for multiple descriptors in a single wallet. However there is no information currently given for such applications to link a coin with an imported descriptor, severely limiting the possibilities for such applications of using multiple descriptors in a single wallet. This PR outputs the matching imported descriptor(s) for a given received coin in `listsinceblock` (and friends).

  It comes from a need for an application i'm working on, but i think it's something any software using `bitcoind` to track multiple descriptors in a single wallet would have eventually. For instance i'm thinking about the BDK project. Currently, the way to achieve this is to import raw addresses with labels and to have your application be responsible for wallet things like the gap limit.

  I'll add this to the output of `listunspent` too if this gets a few Concept ACKs.

ACKs for top commit:
  instagibbs:
    ACK a6b0c1fcc0
  achow101:
    re-ACK a6b0c1fcc0

Tree-SHA512: 7a5850e8de98b439ddede2cb72de0208944f8cda67272e8b8037678738d55b7a5272375be808b0f7d15def4904430e089dafdcc037436858ff3292c5f8b75e37
2022-08-16 13:08:05 -04:00
Antoine Poinsot
a6b0c1fcc0
doc: add releases notes for 25504 (listsinceblock updates) 2022-08-16 18:33:12 +02:00
Antoine Poinsot
0fd2d14454
rpc: add an include_change parameter to listsinceblock
It's useful for an external application tracking coins to not be limited
by our change detection. For instance, for a watchonly wallet with two
descriptors a transaction from one to the other would be considered a
change output and not be included in the result (if the address was not
generated by this wallet).
2022-08-16 18:33:05 +02:00
MacroFake
fac04cb6ba
refactor: Add lock annotations to Active* methods
This is a refactor, putting the burden to think about thread safety to
the caller. Otherwise, there is a risk that the caller will assume
thread safety where none exists, as is evident in the previous two
commits.
2022-08-16 17:26:40 +02:00