A better way to convert between uint160 and uint256 types.

This commit is contained in:
JoelKatz
2011-12-15 16:52:50 -08:00
parent 56484476a9
commit 8083b677e2
5 changed files with 24 additions and 27 deletions

View File

@@ -67,7 +67,7 @@ AccountState::pointer Ledger::getAccountState(const uint160& accountID)
std::cerr << "Ledger:getAccountState(" << accountID.GetHex() << ")" << std::endl;
#endif
ScopedLock l(mTransactionMap->Lock());
SHAMapItem::pointer item=mAccountStateMap->peekItem(uint160to256(accountID));
SHAMapItem::pointer item=mAccountStateMap->peekItem(accountID.to256());
if(!item)
{
#ifdef DEBUG
@@ -81,7 +81,7 @@ AccountState::pointer Ledger::getAccountState(const uint160& accountID)
uint64 Ledger::getBalance(const uint160& accountID)
{
ScopedLock l(mTransactionMap->Lock());
SHAMapItem::pointer item=mAccountStateMap->peekItem(uint160to256(accountID));
SHAMapItem::pointer item=mAccountStateMap->peekItem(accountID.to256());
if(!item) return 0;
return AccountState(item->getData()).getBalance();
}