Browse Source

Remove numberOf.

cl-refactor
Gav Wood 10 years ago
parent
commit
e904462675
  1. 12
      libethereum/Client.cpp
  2. 3
      libethereum/Client.h

12
libethereum/Client.cpp

@ -729,16 +729,6 @@ void Client::doWork()
} }
} }
unsigned Client::numberOf(int _n) const
{
if (_n > 0)
return _n;
else if (_n == GenesisBlock)
return 0;
else
return m_bc.details().number + max(-(int)m_bc.details().number, 1 + _n);
}
State Client::asOf(unsigned _h) const State Client::asOf(unsigned _h) const
{ {
ReadGuard l(x_stateDB); ReadGuard l(x_stateDB);
@ -747,7 +737,7 @@ State Client::asOf(unsigned _h) const
else if (_h == LatestBlock) else if (_h == LatestBlock)
return m_preMine; return m_preMine;
else else
return State(m_stateDB, m_bc, m_bc.numberHash(numberOf(_h))); return State(m_stateDB, m_bc, m_bc.numberHash(_h));
} }
State Client::state(unsigned _txi, h256 _block) const State Client::state(unsigned _txi, h256 _block) const

3
libethereum/Client.h

@ -380,9 +380,6 @@ private:
virtual bool turbo() const { return m_turboMining; } virtual bool turbo() const { return m_turboMining; }
virtual bool force() const { return m_forceMining; } virtual bool force() const { return m_forceMining; }
/// Return the actual block number of the block with the given int-number (positive is the same, INT_MIN is genesis block, < 0 is negative age, thus -1 is most recently mined, 0 is pending.
unsigned numberOf(int _b) const;
/// Returns the state object for the full block (i.e. the terminal state) for index _h. /// Returns the state object for the full block (i.e. the terminal state) for index _h.
/// Works properly with LatestBlock and PendingBlock. /// Works properly with LatestBlock and PendingBlock.
State asOf(unsigned _h) const; State asOf(unsigned _h) const;

Loading…
Cancel
Save