bitcoin/src/wallet
Andrew Chow 1dec90d95b
Merge bitcoin/bitcoin#25526: wallet: avoid double keypool TopUp() call on descriptor wallets
bfb9b94ebe wallet: remove duplicate descriptor type check in GetNewDestination (furszy)
76b982a4a5 wallet: remove unused `nAccountingEntryNumber` field (furszy)
599ff5adfc wallet: avoid double TopUp() calls on descriptor wallets (furszy)

Pull request description:

  Found it while was digging over a `getnewaddress` timeout on the functional test suite.

  ### Context:

  We are calling `TopUp()` twice in the following flows for descriptor wallets:

  A) `CWallet::GetNewDestination`:
     1) Calls spk_man->TopUp()
     2) Calls spk_man->GetNewDestination() --> which, after the basic script checks, calls TopUp() again.

  B) `CWallet::GetReservedDestination`:
     1) Calls spk_man->TopUp()
     2) Calls spk_man->GetReservedDestination() --> which calls to GetNewDestination (which calls to TopUp again).

  ### Changes:

  Move `TopUp()` responsibility from the wallet class to each scriptpubkeyman.
  So each spkm can decide to call it or not after perform the basic checks
  for the new destination request.

  Aside from that, remove the unused `nAccountingEntryNumber` wallet field. And a duplicated descriptor type check in `GetNewDestination`

ACKs for top commit:
  aureleoules:
    re-ACK bfb9b94ebe.
  achow101:
    ACK bfb9b94ebe
  theStack:
    Code-review ACK bfb9b94ebe

Tree-SHA512: 3ab73f37729e50d6c6a4434f676855bc1fb404619d63c03e5b06ce61c292c09c59d64cb1aa3bd9277b06f26988956991d62c90f9d835884f41ed500b43a12058
2022-10-13 11:27:38 -04:00
..
rpc Merge bitcoin/bitcoin#26205: wallet: #25768 follow ups 2022-10-13 12:09:44 +08:00
test Merge bitcoin/bitcoin#26203: wallet: Use correct effective value when checking target 2022-10-04 09:57:17 +01:00
bdb.cpp Merge bitcoin/bitcoin#25499: Use steady clock for all millis bench logging 2022-09-16 11:10:15 +01:00
bdb.h
coincontrol.cpp
coincontrol.h
coinselection.cpp
coinselection.h
context.cpp
context.h
crypter.cpp
crypter.h
db.cpp
db.h
dump.cpp
dump.h
external_signer_scriptpubkeyman.cpp
external_signer_scriptpubkeyman.h
feebumper.cpp
feebumper.h
fees.cpp
fees.h
init.cpp
interfaces.cpp Merge bitcoin/bitcoin#26005: Wallet: Fix error handling (copy_file failure in RestoreWallet, and in general via interfaces) 2022-09-19 16:10:47 +01:00
ismine.h
load.cpp
load.h
receive.cpp
receive.h
salvage.cpp
salvage.h
scriptpubkeyman.cpp Merge bitcoin/bitcoin#25526: wallet: avoid double keypool TopUp() call on descriptor wallets 2022-10-13 11:27:38 -04:00
scriptpubkeyman.h Implement LegacyScriptPubKeyMan::DeleteRecords 2022-08-26 13:14:51 -04:00
spend.cpp wallet: Use correct effective value when checking target 2022-10-02 01:34:25 +02:00
spend.h
sqlite.cpp
sqlite.h
transaction.cpp
transaction.h wallet: Deduplicate Resend and ReacceptWalletTransactions 2022-08-29 12:38:06 -04:00
wallet.cpp Merge bitcoin/bitcoin#25526: wallet: avoid double keypool TopUp() call on descriptor wallets 2022-10-13 11:27:38 -04:00
wallet.h Merge bitcoin/bitcoin#25526: wallet: avoid double keypool TopUp() call on descriptor wallets 2022-10-13 11:27:38 -04:00
walletdb.cpp wallet: bugfix, load wallet with an unknown descriptor cause fatal error 2022-09-09 15:35:04 -03:00
walletdb.h wallet: bugfix, load wallet with an unknown descriptor cause fatal error 2022-09-09 15:35:04 -03:00
wallettool.cpp
wallettool.h
walletutil.cpp
walletutil.h Implement LegacyScriptPubKeyMan::MigrateToDescriptor 2022-08-25 16:25:53 -04:00