| 271 | } |
| 272 | |
| 273 | Account* ChainDataModel::getAccount(ObjectId id) |
| 274 | { |
| 275 | auto& by_id_idx = m_accounts.get<by_id>(); |
| 276 | auto itr = by_id_idx.find(id); |
| 277 | if( itr == by_id_idx.end() ) |
| 278 | { |
| 279 | auto tmp = new Account(id, tr("Account #%1").arg(--m_account_query_num), this); |
| 280 | auto result = m_accounts.insert(tmp); |
| 281 | assert(result.second); |
| 282 | |
| 283 | // Run in RPC thread |
| 284 | m_rpc_thread->async([this, id, result]{getAccountImpl(idToString(account_id_type(id)), &*result.first);}); |
| 285 | return *result.first; |
| 286 | } |
| 287 | return *itr; |
| 288 | } |
| 289 | |
| 290 | Account* ChainDataModel::getAccount(QString name) |
| 291 | { |
no test coverage detected