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(