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-10-05 11:10:37 +02:00
2021-09-10 11:18:58 +08:00
2021-11-16 09:56:45 +01:00
2021-09-29 14:10:29 +02:00
2021-10-20 11:54:03 +05:30
2021-10-12 14:36:51 +13:00
2021-10-26 15:54:52 +01:00
2021-11-16 08:42:21 +01:00
2021-10-05 11:10:47 -04:00
2021-10-05 17:28:02 +02:00
2021-10-21 09:36:07 +08:00
2021-11-16 16:09:25 +08:00
2021-11-16 09:56:45 +01:00
2021-10-22 12:32:16 +02:00
2021-11-21 23:46:21 +02:00
2021-11-17 09:25:14 +01:00
2021-11-16 13:38:12 +01:00
2021-07-14 14:43:45 -07:00
2021-10-20 18:36:40 -04:00
2021-11-17 09:25:14 +01:00
2021-10-11 20:45:56 +08:00
2021-11-19 17:18:59 +01:00
2021-11-22 17:08:26 +13:00
2021-11-16 09:56:45 +01:00
2021-11-12 11:46:34 +01:00
2021-09-07 09:11:10 +02:00
2021-10-05 11:10:47 -04:00
2021-09-28 22:21:10 -04:00
2021-11-10 17:38:45 +01:00
2021-11-10 17:38:45 +01:00
2021-11-09 17:09:50 +00:00
2020-12-31 09:45:41 +01:00
2021-07-30 11:21:51 +02:00
2021-11-16 09:56:45 +01:00
2021-01-31 17:35:16 +01:00
2020-12-31 09:45:41 +01:00
2021-08-20 15:49:50 -04:00
2021-03-17 17:59:22 -07:00
2021-08-17 16:54:47 +08:00
2021-11-11 13:14:01 +01:00
2021-08-17 16:54:47 +08:00
2021-10-12 12:45:55 +02:00
2021-08-17 16:54:47 +08:00
2021-06-18 20:10:07 +02:00
2021-08-17 16:54:47 +08:00
2021-11-01 11:25:42 +08:00
2021-08-17 16:54:47 +08:00
2021-10-01 13:51:10 +00:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-10-20 15:52:08 +02:00
2021-10-14 17:49:52 +05:30
2021-07-09 11:19:36 +02:00
2021-10-25 10:44:17 -04:00
2020-12-31 09:45:41 +01:00
2021-07-30 11:03:44 +02:00
2021-10-01 13:51:10 +00:00
2021-08-16 16:04:47 +08:00
2021-08-16 16:04:47 +08:00
2021-06-17 09:47:08 -04:00
2021-06-17 09:47:08 -04:00
2021-03-01 17:36:16 +01:00
2021-05-04 06:53:32 +02:00
2021-10-05 10:42:34 +02:00
2021-10-11 09:17:28 +02:00
2021-10-05 10:42:34 +02:00
2021-01-04 12:23:16 +08:00
2021-11-15 12:08:49 -05:00
2021-02-01 15:17:28 +01:00
2021-06-30 08:19:12 +10:00
2021-06-30 08:19:12 +10:00
2021-08-02 23:48:32 +10:00
2021-07-01 20:20:52 +02:00
2021-09-30 12:06:27 +13:00
2021-08-24 11:30:09 +02:00
2021-06-16 10:48:58 +02:00
2021-10-05 11:10:47 -04:00
2021-10-22 04:03:45 +03:00
2021-11-15 12:08:49 -05:00
2021-10-05 23:53:33 +02:00
2021-04-23 11:35:15 -07:00
2021-09-02 13:17:46 +08:00
2021-11-16 09:56:45 +01:00
2021-10-04 22:45:43 +02:00
2021-10-05 11:10:47 -04:00
2021-11-16 09:56:45 +01:00
2021-11-15 18:08:49 +01:00
2021-07-12 21:46:59 +08:00
2021-05-24 12:14:16 -07:00
2021-01-24 02:44:53 +01:00
2021-11-12 12:04:20 -05:00
2021-11-12 12:04:20 -05:00
2021-10-11 21:45:49 +10:00
2021-10-11 21:45:49 +10:00
2021-11-16 16:09:25 +08:00
2021-07-08 12:28:23 +02:00
2021-09-24 15:40:04 +08:00
2021-10-15 01:02:45 +00:00
2021-10-21 09:37:30 +08:00
2020-10-27 19:40:44 +01:00
2021-11-08 07:19:10 +02:00
2021-09-16 13:17:01 -05:00
2021-03-04 12:34:46 +08:00
2021-09-15 15:46:48 -04:00
2021-11-16 19:18:05 +01:00
2021-10-11 20:46:25 +08:00
2021-10-01 13:51:10 +00: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-09-30 07:41:57 +08:00
2021-05-27 13:50:11 -04:00
2021-05-19 19:41:05 +02:00
2021-07-15 12:52:38 -07:00
2021-11-17 09:25:14 +01:00
2021-09-28 22:21:10 -04:00
2021-09-03 05:21:58 -04:00
2021-09-03 05:21:58 -04:00
2021-11-17 09:25:14 +01:00
2021-11-02 13:40:09 +01:00
2021-11-03 14:58:54 +01:00
2021-11-17 17:06:55 +01:00
2021-11-03 14:58:53 +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
2020-12-31 09:45:41 +01:00
2021-08-04 19:20:32 +08:00
2021-08-04 19:20:32 +08:00
2021-10-22 12:32:16 +02:00
2021-08-23 18:53:34 +02:00
2021-11-16 13:38:12 +01:00
2021-06-12 12:25:28 -07:00
2021-10-05 23:53:33 +02:00
2021-11-09 12:39:01 +01:00
2021-05-04 06:55:31 +02:00
2021-09-24 15:40:04 +08:00
2021-11-16 09:56:45 +01:00
2021-10-19 15:47:53 +02:00
2021-10-01 13:51:10 +00:00
2021-11-16 09:56:45 +01:00
2021-05-31 14:56:17 +02:00
2021-04-04 18:08:36 +02:00
2021-11-16 09:56:45 +01:00
2021-09-07 09:11:10 +02:00
2021-03-15 10:41:30 +08:00
2021-11-17 17:06:55 +01:00
2021-05-05 20:19:03 +02:00
2021-09-29 18:46:30 +02:00
2021-09-06 23:43:51 +02:00
2021-11-16 09:56:45 +01:00
2020-12-31 09:45:41 +01:00
2021-09-27 06:57:20 -04:00
2021-07-05 08:59:38 +03:00
2021-10-05 11:10:47 -04:00
2021-11-16 09:56:45 +01:00
2021-09-27 06:57:20 -04:00
2021-08-20 16:59:41 +02:00
2021-11-03 08:59:03 +01:00
2021-11-03 08:59:03 +01:00
2021-02-27 01:08:09 +10:00
2021-07-20 13:12:42 +01:00
2021-10-22 12:32:16 +02:00
2020-10-12 12:14:53 -07:00
2020-12-31 09:45:41 +01:00
2021-05-24 12:14:16 -07:00
2021-11-10 14:35:22 +01:00
2021-11-10 14:35:22 +01:00
2020-09-22 11:34:30 -04:00
2020-09-22 11:34:30 -04:00
2020-12-31 09:45:41 +01:00
2021-06-30 08:19:12 +10:00
2021-06-30 08:19:12 +10:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-11-16 09:56:45 +01:00