From 2c16f78fee1f175cc11bd2418efd120310672f08 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 26 Sep 2022 16:48:58 -0600 Subject: [PATCH] zcash_client_sqlite: fix wallet::get_max_account_id This had the same bug as was fixed in 5b8ec380a006ccc0ccb38c11cc6832e1176015c0 --- zcash_client_sqlite/src/wallet.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zcash_client_sqlite/src/wallet.rs b/zcash_client_sqlite/src/wallet.rs index d36380e1f..3d144e066 100644 --- a/zcash_client_sqlite/src/wallet.rs +++ b/zcash_client_sqlite/src/wallet.rs @@ -183,12 +183,12 @@ pub(crate) fn get_max_account_id

( wdb: &WalletDb

, ) -> Result, SqliteClientError> { // This returns the most recently generated address. - Ok(wdb - .conn + wdb.conn .query_row("SELECT MAX(account) FROM accounts", NO_PARAMS, |row| { - row.get::<_, u32>(0).map(AccountId::from) + let account_id: Option = row.get(0)?; + Ok(account_id.map(AccountId::from)) }) - .optional()?) + .map_err(SqliteClientError::from) } pub(crate) fn add_account(