Commit Graph

42081 Commits

Author SHA1 Message Date
Ava Chow
338b9d82dc
Merge bitcoin/bitcoin#30681: Have miner account for timewarp mitigation, activate on regtest, lower nPowTargetTimespan to 144 and add test
59ff17e5af miner: adjust clock to timewarp rule (Sjors Provoost)
e929054e12 Add timewarp attack mitigation test (Sjors Provoost)
e85f386c4b consensus: enable BIP94 on regtest (Sjors Provoost)
dd154b0568 consensus: lower regtest nPowTargetTimespan to 144 (Sjors Provoost)

Pull request description:

  Because #30647 reduced the timewarp attack threshold from 7200s to 600s, our miner code will fail to propose a block template (on testnet4) if the last block of the previous period has a timestamp two hours in the future. This PR fixes that and also adds a test.

  The non-test changes in the last commit should be in v28, otherwise miners have to patch it themselves. If necessary I can split that out into a separate PR, but I prefer to get the tests in as well.

  In order to add the test, we activate BIP94 on regtest.

  In order for the test to run faster, we reduce its difficulty retarget period to 144, the same number that's already used for softfork activation logic. Regtest does not actually adjust its difficulty, so this change has no effect (except for `getnetworkhashps`, see commit).

  An alternative approach would be to run this test on testnet4, by hardcoding its first 2015 in the test suite. But since the timewarp mitigation is a serious candidate for a future mainnet softfork, it seems better to just deploy it on regtest.

  The next commits add a test and fix the miner code.

  The `MAX_TIMEWARP` constant is moved to `consensus.h` so both validation and miner code have access to it.

ACKs for top commit:
  achow101:
    ACK 59ff17e5af
  fjahr:
    ACK 59ff17e5af
  glozow:
    ACK 59ff17e5af

Tree-SHA512: 50af9fdcba9b0d5c57e1efd5feffd870bd11b5318f1f8b0aabf684657f2d33ab108d5f00b1475fe0d38e8e0badc97249ef8dda20c7f47fcc1698bc1008798830
2024-08-22 12:15:19 -04:00
glozow
5ce2285b87
Merge bitcoin/bitcoin#30691: Fix maybe-uninitialized warning in IsSpentKey
17707db939 Fix maybe-uninitialized warning in IsSpentKey (Ava Chow)

Pull request description:

  After 6ed424f2db, I started seeing a maybe-unitialized warning in `CWallet::IsSpentKey`:

  ```
  In destructor ‘constexpr std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’,
      inlined from ‘constexpr std::vector<_Tp, _Alloc>::~vector() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_vector.h:738:7,
      inlined from ‘constexpr WitnessUnknown::~WitnessUnknown()’ at ./addresstype.h:95:8,
      inlined from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = WitnessUnknown]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_construct.h:88:18,
      inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = WitnessUnknown]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_construct.h:149:22,
      inlined from ‘std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)> mutable [with auto:20 = WitnessUnknown&]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:498:19,
      inlined from ‘constexpr _Res std::__invoke_impl(__invoke_other, _Fn&&, _Args&& ...) [with _Res = void; _Fn = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>; _Args = {WitnessUnknown&}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/invoke.h:61:36,
      inlined from ‘constexpr std::enable_if_t<is_invocable_r_v<_Res, _Callable, _Args ...>, _Res> std::__invoke_r(_Callable&&, _Args&& ...) [with _Res = void; _Callable = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>; _Args = {WitnessUnknown&}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/invoke.h:111:28,
      inlined from ‘static constexpr decltype(auto) std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<_Result_type (*)(_Visitor, _Variants ...)>, std::integer_sequence<long unsigned int, __indices ...> >::__visit_invoke(_Visitor&&, _Variants ...) [with _Result_type = void; _Visitor = std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>&&; _Variants = {std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>&}; long unsigned int ...__indices = {8}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:1064:40,
      inlined from ‘constexpr decltype(auto) std::__do_visit(_Visitor&&, _Variants&& ...) [with _Result_type = void; _Visitor = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_reset()::<lambda(auto:20&&)>; _Variants = {variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>&}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:1823:5,
      inlined from ‘constexpr void std::__detail::__variant::_Variant_storage<false, _Types ...>::_M_reset() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:496:23,
      inlined from ‘constexpr std::__detail::__variant::_Variant_storage<false, _Types ...>::~_Variant_storage() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:506:17,
      inlined from ‘constexpr std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Copy_ctor_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:581:12,
      inlined from ‘constexpr std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Move_ctor_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:618:12,
      inlined from ‘constexpr std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Copy_assign_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:656:12,
      inlined from ‘constexpr std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Move_assign_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:708:12,
      inlined from ‘constexpr std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::~_Variant_base()’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:762:12,
      inlined from ‘constexpr std::variant<_Types>::~variant() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/variant:1432:28,
      inlined from ‘bool wallet::CWallet::IsSpentKey(const CScript&) const’ at wallet/wallet.cpp:1055:37:
  /usr/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/c++/bits/stl_vector.h:370:31: error: ‘*(std::_Vector_base<unsigned char, std::allocator<unsigned char> >*)((char*)&<unnamed> + offsetof(const std::CTxDestination, std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>::_M_u) + 8).std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_impl.std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl_data::_M_end_of_storage’ may be used uninitialized [-Werror=maybe-uninitialized]
    370 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
        |                       ~~~~~~~~^~~~~~~~~~~~~~~~~
  wallet/wallet.cpp: In member function ‘bool wallet::CWallet::IsSpentKey(const CScript&) const’:
  wallet/wallet.cpp:1055:37: note: ‘<anonymous>’ declared here
   1055 |         if (IsAddressPreviouslySpent(pkh_dest)) {
        |             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
  ```

  Refactoring the function so that the `WitnessV0KeyHash`, `ScriptHash`, and `PKHash` are constructed within an `if` statement seems to make it go away without changing behavior.

ACKs for top commit:
  maflcko:
    lgtm ACK 17707db939
  l0rinc:
    utACK 17707db939
  hebasto:
    ACK 17707db939, tested on Ubuntu 24.04. The warning has been silenced for both GCC 13.2.0 and 14.0.1.
  tdb3:
    ACK 17707db939
  BrandonOdiwuor:
    Code Review ACK 17707db939

Tree-SHA512: df10a494adfaecb29060f3936d2910aa4291e8caa2a64cbd48e57ed67208f16a02441a14a599a092e0e8de3b338866f666f042b9c6109d0003c0d3e7af4daf48
2024-08-22 15:08:02 +01:00
Ava Chow
17707db939 Fix maybe-uninitialized warning in IsSpentKey 2024-08-21 14:06:49 -04:00
Ava Chow
bc87ad9854
Merge bitcoin/bitcoin#30636: test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstate
917e70a620 test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstate (Sebastian Falbesoner)

Pull request description:

  Inspired by some manual testing I did for #28553, this PR checks that RPCs which explicitly query the UTXO set database (i.e. `gettxoutsetinfo`, `scantxoutset` and `gettxout`) operate on the snapshot chainstate as expected.

ACKs for top commit:
  fjahr:
    utACK 917e70a620
  achow101:
    ACK 917e70a620
  tdb3:
    ACK 917e70a620

Tree-SHA512: 40ecd1c5dd879234df1667fa5444a1fbbee9b7c456f597dc982d1a2bce46fe9107711b005ab829e570ef919a4914792f72f342d71d92bad2ae9434b5e68d5bd3
2024-08-21 13:30:00 -04:00
Ava Chow
60b816439e
Merge bitcoin/bitcoin#30644: fuzz: Faster utxo_snapshot fuzz target
fa899fb7aa fuzz: Speed up utxo_snapshot fuzz target (MarcoFalke)
fa386642b4 fuzz: Speed up utxo_snapshot by lazy re-init (MarcoFalke)
fa645c7a86 fuzz: Remove unused DataStream object (MarcoFalke)
fae8c73d9e test: Disallow fee_estimator construction in ChainTestingSetup (MarcoFalke)

Pull request description:

  Two commits to speed up unit and fuzz tests.

  Can be tested by running the fuzz target and looking at the time it took, or by looking at the flamegraph. For example:

  ```
  FUZZ=utxo_snapshot perf record -g --call-graph dwarf ./src/test/fuzz/fuzz  -runs=100
  hotspot ./perf.data

ACKs for top commit:
  TheCharlatan:
    Re-ACK fa899fb7aa
  marcofleon:
    Re ACK fa899fb7aa
  brunoerg:
    ACK fa899fb7aa

Tree-SHA512: d3a771bb12d7ef491eee61ca47325dd1cea5c20b6ad42554babf13ec98d03bef8e7786159d077e59cc7ab8112495037b0f6e55edae65b871c7cf1708687cf717
2024-08-20 22:41:53 -04:00
Sjors Provoost
59ff17e5af
miner: adjust clock to timewarp rule 2024-08-20 18:51:37 +02:00
Sjors Provoost
e929054e12
Add timewarp attack mitigation test 2024-08-20 18:49:59 +02:00
Sjors Provoost
e85f386c4b
consensus: enable BIP94 on regtest 2024-08-20 13:25:00 +02:00
Sebastian Falbesoner
917e70a620 test: assumeutxo: check that UTXO-querying RPCs operate on snapshot chainstate 2024-08-20 12:43:58 +02:00
Sjors Provoost
dd154b0568
consensus: lower regtest nPowTargetTimespan to 144
This currently has no effect due to fPowNoRetargeting,
except for the getnetworkhashps when called with -1.

It will when the next commit enforces the timewarp attack mitigation on regtest.
2024-08-20 10:07:30 +02:00
MarcoFalke
fa899fb7aa
fuzz: Speed up utxo_snapshot fuzz target
This speeds up the fuzz target, which allows "valid" inputs. It does not
affect the "INVALID" fuzz target.
2024-08-20 07:54:04 +02:00
Ava Chow
d79ea809d2
Merge bitcoin/bitcoin#30647: Move maximum timewarp attack threshold back to 600s from 7200s
16e95bda86 Move maximum timewarp attack threshold back to 600s from 7200s (Matt Corallo)

Pull request description:

  In 6bfa26048d the testnet4 timewarp attack fix block time variation was increased from the Great Consensus Cleanup value of 600s to 7200s on the thesis that this allows miners to always create blocks with the current time. Sadly, doing so does allow for some nonzero inflation, even if not a huge amount.

  While it could be that some hardware ignores the timestamp provided to it over Stratum and forces the block header timestamp to the current time, I'm not aware of any such hardware, and it would also likely suffer from random invalid blocks due to relying on NTP anyway, making its existence highly unlikely.

  This leaves the only concern being pools, but most of those rely on work generated by Bitcoin Core (in one way or another, though when spy mining possibly not), and it seems likely that they will also not suffer any lost work. While its possible that a pool does generate invalid work due to spy mining or otherwise custom logic, it seems unlikely that a substantial portion of hashrate would do so, making the difference somewhat academic (any pool that screws this up will only do so once and the network would come out just fine).

  Further, while we may end up deciding these assumptions were invalid and we should instead use 7200s, it seems prudent to try with the value we "want" on testnet4, giving us the ability to learn if the compatibility concerns are an issue before we go to mainnet.

ACKs for top commit:
  fjahr:
    tACK 16e95bda86
  achow101:
    ACK 16e95bda86
  murchandamus:
    crACK 16e95bda86

Tree-SHA512: ae46d03b728b6e23cb6ace64c9813bc01c01e38dd7f159cf0fab53b331ef84b3b811edab225453ccdfedb53b242f55b0efd69829782657490fe393d24dacbeb2
2024-08-19 15:15:02 -04:00
glozow
ee367170cb
Merge bitcoin/bitcoin#30621: wallet: fix blank legacy detection
6ed424f2db wallet: fix, detect blank legacy wallets in IsLegacy (furszy)

Pull request description:

  Blank legacy wallets do not have active SPKM. They can only be
  detected by checking the descriptors' flag or the db format.

  This enables the migration of blank legacy wallets in the GUI.

  To test this:
  1) Create a blank legacy wallet.
  2) Try to migrate it using the GUI's toolbar "Migrate Wallet" button.
      -> In master: The button will be disabled because `CWallet::IsLegacy()` returns false for blank legacy wallet.
      -> In this PR: the button will be enabled, allowing the migration of legacy wallets.

ACKs for top commit:
  achow101:
    ACK 6ed424f2db
  tdb3:
    ACK 6ed424f2db
  glozow:
    ACK 6ed424f2db

Tree-SHA512: c06c4c4c2e546ccb033287b9aa3aee4ca36b47aeb2fac6fbed5de774b65caef9c818fc8dfdaac6ce78839b2d5d642a5632a5b44c5e889ea169ced80ed50501a7
2024-08-16 16:54:05 +01:00
glozow
6474132d1b
Merge bitcoin/bitcoin#30657: test: add functional test for XORed block/undo files (-blocksxor option)
faa1b9b0e6 test: add functional test for XORed block/undo files (`-blocksxor`) (Sebastian Falbesoner)
6b3676be3e test: refactor: move `read_xor_key`/`util_xor` helpers to util module (Sebastian Falbesoner)

Pull request description:

  This PR adds a dedicated functional test for XORed block data/undo file support (bitcoind option `-blocksxor`, see PR #28052). In order to verify that the XOR pattern has been applied, the {blk,rev}*.dat files are rewritten un-XORed manually by the test while the node is shut down; the node is then started again with `-blocksxor=0`, and both the data and undo files are verified via the `verifychain` RPC (with checklevel=2). Note that starting bitcoind with `-blocksxor=0` fails if a xor key is present already, which is also tested explicitly.

  Fixes #30599.

ACKs for top commit:
  glozow:
    ACK faa1b9b0e6
  maflcko:
    ACK faa1b9b0e6
  ismaelsadeeq:
    Tested ACK faa1b9b0e6

Tree-SHA512: e1df106f6b4e3ba67eca108e36d762f1b991673b881934b84cd36946496a09ce9c329c1363c36aa29409137ae4881e2d177e651359686511632ddf2870f7ca8e
2024-08-16 16:24:46 +01:00
MarcoFalke
fa386642b4
fuzz: Speed up utxo_snapshot by lazy re-init
The re-init is expensive, so skip it if there is no need.

Also, add an even faster fuzz target utxo_snapshot_invalid, which does
not need any re-init at all.
2024-08-16 08:06:59 +02:00
Ava Chow
99ecb9a630
Merge bitcoin/bitcoin#30659: wallet: fix UnloadWallet thread safety assumptions
f550a8e035 Rename ReleaseWallet to FlushAndDeleteWallet (furszy)
64e736d79e wallet: WaitForDeleteWallet, do not expect thread safety (Ryan Ofsky)
8872b4a6ca wallet: rename UnloadWallet to WaitForDeleteWallet (furszy)
5d15485aaf wallet: unload, notify GUI as soon as possible (furszy)

Pull request description:

  Coming from #29073.

  Applied ryanofsky suggested changes on https://github.com/bitcoin/bitcoin/issues/29073#issuecomment-2274237242 with few modifications coming from https://github.com/bitcoin/bitcoin/pull/18338#issuecomment-605060348.

  The only point I did not tackle from https://github.com/bitcoin/bitcoin/pull/18338#issuecomment-605060348 is:

  > * Move log print and flush out of ReleaseWallet into CWallet destructor

  Because it would mean every `CWallet` object would flush data to disk during destruction. Which is not necessary for wallet tool utilities and unit tests.

ACKs for top commit:
  achow101:
    ACK f550a8e035
  ryanofsky:
    Code review ACK f550a8e035. Just a simple rename since last review
  ismaelsadeeq:
    Re-ACK f550a8e035

Tree-SHA512: e2eb69bf36883c514f601f4838ae6a41113996b9559abf8dc2b46e16bbcdad401195ac0f2b9d1fb55a10e78bb8ea9953788a168c80474e3f101350d208cb3bd2
2024-08-15 13:22:34 -04:00
furszy
f550a8e035
Rename ReleaseWallet to FlushAndDeleteWallet
To better describe the function's behavior.
And add wallet name to logprint.
2024-08-15 11:54:13 -03:00
glozow
2f7d9aec4d
Merge bitcoin/bitcoin#30655: doc: mention bip94 support
99eeb51bf6 [doc] mention bip94 support (glozow)

Pull request description:

  Followup to #29775, noticed while looking at #30604 and #30647. See [release process](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-every-major-and-minor-release).

ACKs for top commit:
  maflcko:
    ACK 99eeb51bf6
  fjahr:
    ACK 99eeb51bf6
  tdb3:
    ACK 99eeb51bf6

Tree-SHA512: 95838d3ace7e5d7b1a2481f2d7bd82902081713e6e89dbf21e0dad16d1cf5295e0c1cfda1f03af72304a5844743d24769f5fa04d4dc9f02f36462ef0ae82a552
2024-08-15 10:22:18 +01:00
MarcoFalke
fa645c7a86
fuzz: Remove unused DataStream object 2024-08-15 08:53:04 +02:00
Ryan Ofsky
64e736d79e
wallet: WaitForDeleteWallet, do not expect thread safety
Multiple threads could try to delete the wallet at the same time.
2024-08-14 16:14:54 -03:00
furszy
8872b4a6ca
wallet: rename UnloadWallet to WaitForDeleteWallet
And update function's documentation.
2024-08-14 16:12:18 -03:00
furszy
5d15485aaf
wallet: unload, notify GUI as soon as possible
Releases wallet shared pointers prior to doing the
final settings update and prevent GUI races trying
to access a wallet that is no longer loaded.
2024-08-14 16:12:18 -03:00
Ava Chow
0a379a129b
Merge bitcoin/bitcoin#28553: validation: assumeutxo params mainnet
1610643c8b chainparams: add mainnet assumeutxo param at height 840_000 (Sjors Provoost)

Pull request description:

  This adds snapshot parameters for mainnet block 840,000.

  You can generate the snapshot yourself using `./contrib/devtools/utxo_snapshot.sh` or download my torrent:
  * torrent: `magnet:?xt=urn:btih:596c26cc709e213fdfec997183ff67067241440c&dn=utxo-840000.dat&tr=udp%3A%2F%2Ftracker.bitcoin.sprovoost.nl%3A6969`

  It would be a good idea to test:
  1. That you can produce the same snapshot file, sha256 sum:

  ```
  dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b utxo-840000.dat
  ```

  2. That the snapshot works

ACKs for top commit:
  fjahr:
    re-ACK 1610643c8b
  achow101:
    ACK 1610643c8b
  theStack:
    Tested ACK 1610643c8b
  mzumsande:
    tested ACK 1610643c8b
  willcl-ark:
    tACK 1610643c8b

Tree-SHA512: 581d8e86379bb044324f04f8559dd0a8946b6e2b145d5f25b38727b30b8cf13d6ac3c8777ff06554d3cf1a072809f7b5fbd693239868578f25dceafe5ba5f57c
2024-08-14 12:16:28 -04:00
Ava Chow
0e42c1b6c5
Merge bitcoin/bitcoin#30648: doc: Deduplicate list of possible chain strings in RPC help texts
9b29755520 Deduplicate list of chain strings in RPC help texts (Martin Saposnic)

Pull request description:

  As mentioned in issue https://github.com/bitcoin/bitcoin/issues/30645:

  Many command line parameter and RPC help texts currently contain the list of chain/network names hardcoded ("main, test, testnet4, signet, regtest"), which is error-prone as it can easily happen to miss an instance if the list ever changes again.

  This PR deduplicates the list of possible chain/network strings in RPC/parameter help texts, and it creates a macro `LIST_CHAIN_NAMES` in src/chainparamsbase.h. In the future, there is only 1 place where that list of possible values lives, so maintainability is improved and errors are avoided.

  All three places where this change impacts:

  ```
  ./bitcoin-cli --help
  ./bitcoin-cli help getblockchaininfo
  ./bitcoin-cli help getmininginfo
  ```

  They all return the correct string `"main, test, testnet4, signet, regtest"`

  See https://github.com/bitcoin/bitcoin/pull/30642#discussion_r1714711575

ACKs for top commit:
  maflcko:
    lgtm ACK 9b29755520
  achow101:
    ACK 9b29755520
  MarnixCroes:
    ACK 9b29755520
  theStack:
    ACK 9b29755520
  danielabrozzoni:
    ACK 9b29755520

Tree-SHA512: 1e961bcbe40b0f17a87a2437eb4ba1bb89468fd1b5a39599d72a00ef75cb4009e7d2f05d0a621bb904fecf681c55b8a219fcfe4d44d5d27f27cdda20882b1323
2024-08-14 12:01:55 -04:00
Sebastian Falbesoner
faa1b9b0e6 test: add functional test for XORed block/undo files (-blocksxor) 2024-08-14 17:38:28 +02:00
glozow
99eeb51bf6 [doc] mention bip94 support 2024-08-14 15:56:28 +01:00
Sebastian Falbesoner
6b3676be3e test: refactor: move read_xor_key/util_xor helpers to util module 2024-08-14 16:43:46 +02:00
Hennadii Stepanov
9264d62bd9
Merge bitcoin-core/gui#833: Update translation source file for v28.0 string freeze
770b0348c0 qt: Update translation source file for v28.0 string freeze (Hennadii Stepanov)

Pull request description:

  This PR updates the `src/qt/locale/bitcoin_en.xlf` translation source file according to the [Release schedule for 28.0](https://github.com/bitcoin/bitcoin/issues/29891).

  Note for reviewers: it is expected to get a zero diff after running `make -C src translate` locally.

ACKs for top commit:
  stickies-v:
    re-ACK 770b0348c0
  pablomartin4btc:
    re-ACK 770b0348c0

Tree-SHA512: 11dd26c470411aefc2e4f897c605162027a00e2a0ab1dcec9a1784c053349a3feaeedda7b649476ff528231801629e0ef342a48430ef54a4ec75ac1548c56d4f
2024-08-14 15:22:18 +01:00
Hennadii Stepanov
770b0348c0
qt: Update translation source file for v28.0 string freeze
The diff is produced by running `make -C src translate`.
2024-08-14 14:14:10 +01:00
Hennadii Stepanov
e682e7db7e
Merge bitcoin-core/gui#824: Migrate legacy wallets that are not loaded
8f2522d242 gui: Use menu for wallet migration (Ava Chow)
d56a450bf5 gui: Use wallet name for wallet migration rather than WalletModel (Ava Chow)
c3918583dd gui: don't remove wallet manually before migration (furszy)
bfba63880f gui: Consolidate wallet display name to GUIUtil function (Ava Chow)
28fc562f26 wallet, interfaces: Include database format in listWalletDir (Ava Chow)

Pull request description:

  Currently the Migrate Wallet menu item can only be used to migrate the currently loaded wallet. This is not suitable for the future when legacy wallets can no longer be loaded at all, but should still be able to be migrated. This PR changes that menu item into a menu list like Open Wallet and lets users migrate any legacy wallet in their wallet directory regardless of the wallets loaded.

  One issue I ran into was dealing with encrypted wallets. Ideally, we would detect whether a wallet is encrypted, and prompt the user for their passphrase at that time. However, that's actually difficult to do in the GUI since migration will unload the wallet if it was already loaded, and reload it without connecting it to any signals or interfaces. Only then can it detect whether a wallet is encrypted, but then there is no `WalletModel` or even an `interfaces::Wallet` that the GUI could use to unlock it via a callback.

  To deal with this, I've opted to just add a button to the migration dialog box that has the user enter their passphrase first, along with instructional text to use that button if their wallet was encrypted. If the user enters the wrong passphrase or clicked the other button that does not prompt for the passphrase, migration will fail with a message indicating that the passphrase was incorrect.

ACKs for top commit:
  hebasto:
    ACK 8f2522d242.
  furszy:
    ACK 8f2522d

Tree-SHA512: a0e3b70dbfcacb89617956510ebcea94cad8617a987c68fe39fa16ac1721190b7cf7afc156c39b9032920cfb67b5d4ca28791681f5021d92d16acc691387afa1
2024-08-14 14:09:35 +01:00
Ava Chow
8f2522d242 gui: Use menu for wallet migration
Once legacy wallets can no longer be loaded, we need to be able to
migrate them without loading. Thus we should use a menu that lists the
wallets in the wallet directory instead of an action which migrates the
currently loaded wallet.
2024-08-13 19:18:11 -04:00
Matt Corallo
16e95bda86 Move maximum timewarp attack threshold back to 600s from 7200s
In 6bfa26048d the testnet4 timewarp
attack fix block time variation was increased from the Great
Consensus Cleanup value of 600s to 7200s on the thesis that this
allows miners to always create blocks with the current time. Sadly,
doing so does allow for some nonzero inflation, even if not a huge
amount.

While it could be that some hardware ignores the timestamp provided
to it over Stratum and forces the block header timestamp to the
current time, I'm not aware of any such hardware, and it would also
likely suffer from random invalid blocks due to relying on NTP
anyway, making its existence highly unlikely.

This leaves the only concern being pools, but most of those rely on
work generated by Bitcoin Core (in one way or another, though when
spy mining possibly not), and it seems likely that they will also
not suffer any lost work. While its possible that a pool does
generate invalid work due to spy mining or otherwise custom logic,
it seems unlikely that a substantial portion of hashrate would do
so, making the difference somewhat academic (any pool that screws
this up will only do so once and the network would come out just
fine).

Further, while we may end up deciding these assumptions were
invalid and we should instead use 7200s, it seems prudent to try
with the value we "want" on testnet4, giving us the ability to
learn if the compatibility concerns are an issue before we go to
mainnet.
2024-08-13 18:21:03 +00:00
Martin Saposnic
9b29755520
Deduplicate list of chain strings in RPC help texts 2024-08-13 14:00:33 -03:00
Ava Chow
d56a450bf5 gui: Use wallet name for wallet migration rather than WalletModel
To prepare for migrating wallets that are not loaded, when migration
occurs in the GUI, it should not rely on a WalletModel existing.

Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2024-08-13 11:25:38 -04:00
furszy
c3918583dd gui: don't remove wallet manually before migration 2024-08-13 11:25:38 -04:00
Ava Chow
bfba63880f gui: Consolidate wallet display name to GUIUtil function
Instead of having the code for the wallet display name being copy and
pasted, use a GUIUtil function to get that for us.
2024-08-13 11:25:38 -04:00
Ava Chow
28fc562f26 wallet, interfaces: Include database format in listWalletDir 2024-08-13 11:25:38 -04:00
glozow
1a41e63575
Merge bitcoin/bitcoin#30642: doc: add missing "testnet4" network string in RPC/init help texts
7015300455 doc: add missing "testnet4" network string in RPC/init help texts (Sebastian Falbesoner)

Pull request description:

  The following bitcoind parameters / RPC calls still missed the "testnet4" network string:
      - `-chain=` parameter
      - `getblockchaininfo` RPC, `"chain"` result
      - `getmininginfo` RPC, `"chain"` result

  The occurences were found via `$ git grep \".*main.*test.*\"`.

ACKs for top commit:
  maflcko:
    review ACK 7015300455
  glozow:
    ACK 7015300455
  tdb3:
    ACK 7015300455
  BrandonOdiwuor:
    ACK 7015300455
  danielabrozzoni:
    ACK 7015300455

Tree-SHA512: 99bf5c2b4cf28651feaff2fc7d4669961012dfa8379d8522251540ae1b8fc77d1761b75395903b527580530f42a3c1fd2dd2d8dba4ffbc9b6e55cb357c3a271b
2024-08-13 16:01:48 +01:00
glozow
7583eac43c
Merge bitcoin/bitcoin#30617: net: Clarify that m_addr_local is only set once
fa6fe43207 net: Clarify that m_addr_local is only set once (MarcoFalke)

Pull request description:

  The function is supposed to be only called once when the version msg arrives (a single time). Calling it twice would be an internal logic bug. However, the `LogError` in this function has many issues:

  * If the error happens in tests, as is the case for the buggy fuzz test, it will go unnoticed
  * It is dead code, unless a bug is introduced to execute it

  Fix all issues by using `Assume(!m_addr_local.IsValid())` instead. Idea taken from https://github.com/bitcoin/bitcoin/pull/30364#discussion_r1680530382

ACKs for top commit:
  achow101:
    ACK fa6fe43207
  mzumsande:
    utACK fa6fe43207
  glozow:
    ACK fa6fe43207

Tree-SHA512: 8c1e8c524768f4f36cc50110ae54ee423e057a963ff78f736f3bf92df1ce5af28e3e0149153780897944e1d5c22ddbca9dac9865d9f4d44afffa152bc8559405
2024-08-13 10:19:19 +01:00
MarcoFalke
fae8c73d9e
test: Disallow fee_estimator construction in ChainTestingSetup
It is expensive to construct, and only one test uses it.

Fix both issues by disallowing the construction and moving it to the
single test that uses it.
2024-08-13 10:30:44 +02:00
furszy
6ed424f2db
wallet: fix, detect blank legacy wallets in IsLegacy
Blank legacy wallets do not have active SPKM. They can
only be detected by checking the descriptors' flag or
the db format.

This enables the migration of blank legacy wallets in
the GUI.
2024-08-12 18:14:35 -03:00
Sebastian Falbesoner
7015300455 doc: add missing "testnet4" network string in RPC/init help texts
The following bitcoind parameters / RPC calls missed the "testnet4"
network string:
    - `-chain=` parameter
    - `getblockchaininfo` RPC, "chain" result
    - `getmininginfo` RPC, "chain" result
2024-08-12 23:00:47 +02:00
Ava Chow
5fdbc8b4ee
Merge bitcoin/bitcoin#30246: contrib: asmap-tool - Compare ASMaps with respect to specific addresses
5215c925d1 Compare ASMaps with respect to specific addresses (virtu)

Pull request description:

  Right now, we have no way to quantify the "degradation" of an ASMap over time in the context of Bitcoin's P2P network in a meaningful way. However, such data would be useful for:
  1. Making sure the minimum shelf life of ASMaps is compatible with the release cycle (we wouldn't want to start shipping ASMaps with releases before making sure ASMaps typically do not become obsolete before the time of the next release)
  2. Node operators eager to keep their ASMaps up-to-date between releases.

  While `asmap-tool.py` has a `diff` command to perform a prefix-based comparison of two ASMaps, it is hard to reason about whether an old ASMap still is "good enough" or should be replaced with a newer one based on a prefix-based diff such as the following:

  ```shell
  $ ./asmap-tool.py diff 1704463200_asmap.dat 1710770400_asmap.dat
  [...]
  # 2c0f:fc98::/32 was AS37282
  # 2c0f:fcb8::/32 was AS37323
  2c0f:ff18::/32 AS37044 # was unassigned
  2c0f:ff98::/32 AS37113 # was unassigned
  2c0f:ffa0::/32 AS37273 # was unassigned
  # 76082350 (2^26.18) IPv4 addresses changed; 834271985742505274886878979424260 (2^109.36) IPv6 addresses changed
  ```

  One option for a more Bitcoin-centric ASMap comparison comprises comparing ASNs for the addresses of Bitcoin nodes and reporting on the number/share of addresses of nodes with disagreeing ASNs. By applying this approach to a node's set of known peers, a node operator can estimate how many of the node's peers are mapped to out-of-date AS when using the currently deployed and an up-to-date ASMap as input.

  This PR adds this functionality to `asmap-tool.py` by introducing a `diff_addrs` subcommand. In addition to two ASMaps, the subcommand reads addresses from a (`getnodeaddresses`-compatible) file, and computes statistics for those addresses:

  ```bash
  $ ./asmap-tool.py diff_addrs 1704463200_asmap.dat 1710770400_asmap.dat <(bitcoin-cli getnodeaddresses 0)
  275 address(es) reassigned from unassigned to AS51167
  84 address(es) reassigned from AS198949 to AS15557
  66 address(es) reassigned from AS45758 to AS45629
  33 address(es) reassigned from AS174 to AS212238
  [...]
  1 address(es) reassigned from unassigned to AS399619
  Summary: 919 (1.67%) of 54,901 addresses were reassigned.
  ```

  When the `-s / --show-addresses` flag is used, addresses subject to reassignment are included in the output.

ACKs for top commit:
  fjahr:
    tACK 5215c925d1
  achow101:
    ACK 5215c925d1
  brunoerg:
    reACK 5215c925d1

Tree-SHA512: ebcf47754bce92794fad9f4c3bfc1c5e9daf077db5975f444c5135092eb6a26ecaa1eca6748a03ae0c87d9e45532426966fe8f3c17249b17f9dcad490d6dd3bf
2024-08-12 16:17:42 -04:00
Ava Chow
34ea7508d4
Merge bitcoin/bitcoin#30326: optimization: Reduce cache lookups in CCoinsViewCache::FetchCoin
204ca67bba Reduce cache lookups in CCoinsViewCache::FetchCoin (Lőrinc)

Pull request description:

  Enhanced efficiency and readability of `CCoinsViewCache::FetchCoin` by replacing separate `find()` and `emplace()` calls with a single `try_emplace()`, reducing map lookups and potential insertions.

  `AssembleBlock` shows `FetchCoin` as one of its bottlenecks:
  <img src="https://github.com/bitcoin/bitcoin/assets/1841944/79c7f480-aac2-46da-9ac9-526a02a8eafa">

  These changes result in a modest performance improvement:

  >  ./src/bench/bench_bitcoin --filter='AssembleBlock' --min-time=10000

  before:
  |               ns/op |                op/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |          156,160.70 |            6,403.66 |    0.6% |     10.91 | `AssembleBlock`

  after:
  |               ns/op |                op/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |          152,971.97 |            6,537.15 |    0.2% |     10.95 | `AssembleBlock`

  Further benchmarks: https://github.com/bitcoin/bitcoin/pull/30326#issuecomment-2188378721

ACKs for top commit:
  sipa:
    utACK 204ca67bba
  achow101:
    ACK 204ca67bba
  andrewtoth:
    re-ACK 204ca67bba

Tree-SHA512: 65743a5d4edd442672a59d7b3de38fe197c61270a5c8df65712413904559f360fc58b512234558c7e5169ffb4dda3b2d2f7ded92ad5b04ca999828986b251066
2024-08-12 16:16:58 -04:00
Ava Chow
ee57737bd6
Merge bitcoin/bitcoin#28209: fuzz: a target for the block index database
86b38529d5 qa: a fuzz target for the block index database (Antoine Poinsot)

Pull request description:

  This introduces a small fuzz target for `CBlockTreeDB` which asserts a few invariants by using an in-memory LevelDb.

ACKs for top commit:
  achow101:
    ACK 86b38529d5
  TheCharlatan:
    Re-ACK 86b38529d5
  maflcko:
    review ACK 86b38529d5 🥒
  brunoerg:
    utACK 86b38529d5

Tree-SHA512: ab75b4ae1c7e0a4b15f8a6ceffdf509fbc79833e6ea073ecef68558d53b83663d1b30362aaa2d77c22b8890a572f5b1d4b1c5abbca483c8c8f9b1fb5b276a59a
2024-08-12 16:06:38 -04:00
Ava Chow
5b0059fdf9
Merge bitcoin/bitcoin#29999: guix: fix suggested fake date for openssl-1.1.1l
8fee5355ee guix: fix suggested fake date for openssl -1.1.1l (Sjors Provoost)

Pull request description:

  Using `2020-10-01` as the fake timestamp will cause many test failures with `/gnu/store/bfirgq65ndhf63nn4q6vlkbha9zd931q-openssl-1.1.1l.drv`. I didn't investigate why, but I guess because it's _before_ the test certificates were created. They expired in June 2022. I tried a month before that, which worked.

  Also fixes layout of instructions.

ACKs for top commit:
  achow101:
    ACK 8fee5355ee
  maflcko:
    review ACK 8fee5355ee

Tree-SHA512: df5dd3aa961e25bd57d0b8b73daeb3ec76856b06e35277f24b6b19be81774512228f75e2b779afa8ea92fcc39beb869f43e0c57fba19ad16a82812e7c0bea38b
2024-08-12 15:22:58 -04:00
Ava Chow
ba5fdd1a68
Merge bitcoin/bitcoin#30607: contrib: support reading XORed blocks in linearize-data.py script
77ff0ec1f1 contrib: support reading XORed blocks in linearize-data.py script (Sebastian Falbesoner)

Pull request description:

  This PR is a small follow-up for #28052, adding support for the block linearization script to handle XORed blocksdir *.dat files. Note that if no xor.dat file exists, the XOR pattern is set to all-zeros, in order to still support blockdirs that have been created with versions earlier than 28.x.

  Partly fixes issue #30599.

ACKs for top commit:
  achow101:
    ACK 77ff0ec1f1
  tdb3:
    ACK 77ff0ec1f1
  hodlinator:
    ACK 77ff0ec1f1

Tree-SHA512: 011eb02e2411de373cbbf4b26db4640fc693a20be8c2430529fba6e36a3a3abfdfdc3b005d330f9ec2846bfad9bfbf34231c574ba99289ef37dd51a68e6e7f3d
2024-08-12 15:03:35 -04:00
Ava Chow
5c5a298f6d
Merge bitcoin/bitcoin#30563: fuzz: improve scriptpubkeyman target
401cc4ec70 fuzz: improve scriptpubkeyman target (brunoerg)

Pull request description:

  Fixes #30541

  This PR aims to improve `scriptpubkeyman` target to avoid timeouts. The input provided in #30541 takes too much time to run because it basically calls only `MarkUnusedAddresses` (300 times * number of spks). The following changes were made to improve it:

  - Reduce keypool size.
  - When calling `MarkUnusedAddresses`, do it with one of the spks per iteration.
  - Remove the specific `AddDescriptorKey` call since it is already covered with `AddWalletDescriptor`.
  - Limit number of iterations to a reasonable value.

ACKs for top commit:
  maflcko:
    lgtm ACK 401cc4ec70
  achow101:
    ACK 401cc4ec70

Tree-SHA512: 941812bc6d991dd03675a2974ce1b839494ca7f6e6d8a22c689d4bf4fed2dac5491246998f19cb15dbff516fdd8eeda27e7628c3206d45f57dc292bc05624a5c
2024-08-12 14:50:00 -04:00
Hennadii Stepanov
1873e4116f
Merge bitcoin-core/gui#831: GUIUtil::brintToFront workaround for Wayland
15aa7d0236 gui, qt: brintToFront workaround for Wayland (pablomartin4btc)

Pull request description:

  There are known issues around handling windows focus in `Wayland` ([this one specific](https://bugs.kde.org/show_bug.cgi?id=462574) in KDE but also in [gnome](https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/730)).

  The idea is that the workaround will be executed if `bitcoin-qt` is running using `Wayland` platform (e.g.: `QT_QPA_PLATFORM=wayland ./src/qt/bitcoin-qt -regtest`), since the workaround behaviour looks like re-opening the window again (which I tried to fix by moving the window to the original position and/ or re-setting the original geometry without success) while in `X11` (not sure in Mac) the current `GUIUtil::brintToFront` actually sets the focus to the desired window, keeping its original position as expected, and I didn't want to change that (`X11` behaviour).

  The solution was [initially discussed](https://github.com/bitcoin-core/gui/pull/817#issuecomment-2256158902) with hebasto in #817.

ACKs for top commit:
  hebasto:
    ACK 15aa7d0236.

Tree-SHA512: 141d6cc4a618026e551627b9f4cc284285980db02a54a7b19c7de91e8c5adccf0c1d67380625146b5413e58c59f39c9e944ed5ba68cb8644f67647518918b6f7
2024-08-12 17:18:59 +01:00
glozow
b21ba081be
Merge bitcoin/bitcoin#30265: wallet: Fix listwalletdir listing of migrated default wallets and generated backup files
6b2dcba076 wallet: List sqlite wallets with empty string name (Ava Chow)
3ddbdd1815 wallet: Ignore .bak files when listing wallet files (Ava Chow)

Pull request description:

  When the default wallet is migrated, we do not rename the wallet so we end up having a descriptor wallet with the empty string as its name and the wallet.dat file in the root of the walletdir. This is supposed to be an unsupported configuration and there is no other way to achieve this (other than file copying), but the wallet loading code does not disallow loading such wallets. However `listwalletdir` does not currently list the default wallet if it is sqlite. This is confusing to users, so change `listwalletdir` to include these wallets.

  Additionally, the migration of the default wallet, and of any plain wallet files in the walletdir, produces a backup file in the walletdir itself. Since these backups are a BDB file, `listwalletdir` will detect them as being another wallet that we could open, but this is erroneous and could lead to confusion and potentially funds loss if both the backup and the migrated wallet are in use simultaneously. To reduce the likelihood of this issue, don't list these wallets in `listwalletdir`.

  ***

  Possibly we could have more stringent checks on loading to resolve these issues, but I'm concerned that that will just confuse users and gratuitously break things that already worked.

  Since the original intent was to disallow default wallets for sqlite/descriptors, a possible alternative would be to prevent people from loading such wallets and change migration to rename those wallets. However, given that this behavior with migrating default wallets has existed since default wallet migration was fixed, I think that making such a change would be confusing and break things for no good reason. Although perhaps we should still do the renaming.

  For the backups, we could also change loading to refuse to load any wallet named with `.bak` (or `.legacy.bak`) as such wallets can still be loaded by giving the path to them directly, which some users may do to "restore" the backup. However restricting what can be loaded based on filename seems a little heavyhanded. It wouldn't be funds loss though since the correct way to restore the backup is with `restorewallet`.

ACKs for top commit:
  fjahr:
    Code review ACK 6b2dcba076
  furszy:
    Code ACK  6b2dcba076
  glozow:
    ACK 6b2dcba076

Tree-SHA512: 0b033f6ed55830f8a054afea3fb2cf1fa82a94040053ebfaf123bda36c99f45d3f01a2aec4ed02fed9c61bb3d320b047ed892d7f6644b5a356a7bc5974b10cff
2024-08-12 15:58:07 +01:00