Compare commits
2 Commits
3b9f58ea33
...
5d9a58930c
Author | SHA1 | Date |
---|---|---|
str4d | 5d9a58930c | |
Kris Nuttycombe | df52aa844d |
|
@ -144,15 +144,27 @@ fn account_id_from_ffi<P: Parameters>(
|
|||
.filter_map(|account_id| {
|
||||
db_data
|
||||
.get_account(account_id)
|
||||
.transpose()
|
||||
.expect("account_id exists")
|
||||
.map(|account| match account.source() {
|
||||
AccountSource::Derived { account_index, .. }
|
||||
if account_index == requested_account_index =>
|
||||
{
|
||||
Some(account)
|
||||
}
|
||||
_ => None,
|
||||
.map_err(|e| {
|
||||
anyhow!(
|
||||
"Database error encountered retrieving account {:?}: {}",
|
||||
account_id,
|
||||
e
|
||||
)
|
||||
})
|
||||
.and_then(|acct_opt| {
|
||||
acct_opt
|
||||
.ok_or(anyhow!(
|
||||
"Wallet data corrupted: unable to retrieve account data for account {:?}",
|
||||
account_id
|
||||
))
|
||||
.map(|account| match account.source() {
|
||||
AccountSource::Derived { account_index, .. }
|
||||
if account_index == requested_account_index =>
|
||||
{
|
||||
Some(account)
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
})
|
||||
.transpose()
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue