zcash_client_sqlite: fix wallet::get_max_account_id
This had the same bug as was fixed in 5b8ec380a0
This commit is contained in:
parent
c06760e985
commit
2c16f78fee
|
@ -183,12 +183,12 @@ pub(crate) fn get_max_account_id<P>(
|
||||||
wdb: &WalletDb<P>,
|
wdb: &WalletDb<P>,
|
||||||
) -> Result<Option<AccountId>, SqliteClientError> {
|
) -> Result<Option<AccountId>, SqliteClientError> {
|
||||||
// This returns the most recently generated address.
|
// This returns the most recently generated address.
|
||||||
Ok(wdb
|
wdb.conn
|
||||||
.conn
|
|
||||||
.query_row("SELECT MAX(account) FROM accounts", NO_PARAMS, |row| {
|
.query_row("SELECT MAX(account) FROM accounts", NO_PARAMS, |row| {
|
||||||
row.get::<_, u32>(0).map(AccountId::from)
|
let account_id: Option<u32> = row.get(0)?;
|
||||||
|
Ok(account_id.map(AccountId::from))
|
||||||
})
|
})
|
||||||
.optional()?)
|
.map_err(SqliteClientError::from)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn add_account<P: consensus::Parameters>(
|
pub(crate) fn add_account<P: consensus::Parameters>(
|
||||||
|
|
Loading…
Reference in New Issue