Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 4886364

Browse files
author
Anton Autushka
committed
bitshares#151 avoid using the cached version of account_object since it could easily go out of sync
1 parent d113dc4 commit 4886364

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

libraries/wallet/wallet.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,6 @@ class wallet_api_impl
565565
}
566566
account_object get_account(account_id_type id) const
567567
{
568-
if( _wallet.my_accounts.get<by_id>().count(id) )
569-
return *_wallet.my_accounts.get<by_id>().find(id);
570568
auto rec = _remote_db->get_accounts({id}).front();
571569
FC_ASSERT(rec);
572570
return *rec;
@@ -580,19 +578,6 @@ class wallet_api_impl
580578
// It's an ID
581579
return get_account(*id);
582580
} else {
583-
// It's a name
584-
if( _wallet.my_accounts.get<by_name>().count(account_name_or_id) )
585-
{
586-
auto local_account = *_wallet.my_accounts.get<by_name>().find(account_name_or_id);
587-
auto blockchain_account = _remote_db->lookup_account_names({account_name_or_id}).front();
588-
FC_ASSERT( blockchain_account );
589-
if (local_account.id != blockchain_account->id)
590-
elog("my account id ${id} different from blockchain id ${id2}", ("id", local_account.id)("id2", blockchain_account->id));
591-
if (local_account.name != blockchain_account->name)
592-
elog("my account name ${id} different from blockchain name ${id2}", ("id", local_account.name)("id2", blockchain_account->name));
593-
594-
return *_wallet.my_accounts.get<by_name>().find(account_name_or_id);
595-
}
596581
auto rec = _remote_db->lookup_account_names({account_name_or_id}).front();
597582
FC_ASSERT( rec && rec->name == account_name_or_id );
598583
return *rec;

0 commit comments

Comments
 (0)