Files
bitcoin/src
Samuel Dobson a42923ce21 Merge bitcoin/bitcoin#23348: rpc, wallet: Do not return "keypoololdest" for blank descriptor wallets
ee03c782ba wallet: Make GetOldestKeyPoolTime return nullopt for blank wallets (Hennadii Stepanov)
3e4f069d23 wallet, refactor: Make GetOldestKeyPoolTime return type std::optional (Hennadii Stepanov)

Pull request description:

  The "keypoololdest" field in the `getwalletinfo` RPC response should be used for legacy wallets only.

  Th current implementation (04437ee721) assumes that `CWallet::GetOldestKeyPoolTime()` always return `0` for descriptor wallets. This assumption is wrong for _blank_ descriptor wallets, when `m_spk_managers` is empty. As a result:
  ```
  $ src/bitcoin-cli -signet -rpcwallet=211024-d-DPK getwalletinfo
  {
    "walletname": "211024-d-DPK",
    "walletversion": 169900,
    "format": "sqlite",
    "balance": 0.00000000,
    "unconfirmed_balance": 0.00000000,
    "immature_balance": 0.00000000,
    "txcount": 0,
    "keypoololdest": 9223372036854775807,
    "keypoolsize": 0,
    "keypoolsize_hd_internal": 0,
    "paytxfee": 0.00000000,
    "private_keys_enabled": false,
    "avoid_reuse": false,
    "scanning": false,
    "descriptors": true
  }
  ```

  This PR fixes this issue with direct checking of the `WALLET_FLAG_DESCRIPTORS` flag.

ACKs for top commit:
  lsilva01:
    re-ACK ee03c78
  stratospher:
    ACK ee03c78.
  meshcollider:
    Code review ACK ee03c782ba

Tree-SHA512: 9852f9f8ed5c08c07507274d7714f039bbfda66da6df65cf98f67bf11a600167d0f7f872680c95775399477f4df9ba9fce80ec0cbe0adb7f2bb33c3bd65b15df
2021-11-22 17:08:26 +13:00
..
2021-11-17 09:25:14 +01:00
2021-09-10 11:18:58 +08:00
2021-09-29 14:10:29 +02:00
2021-11-17 09:25:14 +01:00
2021-11-17 09:25:14 +01:00
2021-11-12 11:46:34 +01:00
2021-11-09 17:09:50 +00:00
2021-07-30 11:21:51 +02:00
2020-12-31 09:45:41 +01:00
2021-03-17 17:59:22 -07:00
2021-11-15 12:08:49 -05:00
2021-11-16 09:56:45 +01:00
2021-10-11 21:45:49 +10:00
2021-01-07 18:07:09 +02:00
2021-01-04 12:31:31 +08:00
2021-10-05 11:11:18 +02:00
2021-11-17 09:25:14 +01:00
2021-04-06 14:50:17 +08:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-09-29 18:46:30 +02:00
2021-08-20 16:59:41 +02:00
2020-10-12 12:14:53 -07:00