Browse Source

Fix whitespace :-/

cl-refactor
Gav Wood 10 years ago
parent
commit
e7b40e5bdc
  1. 4
      alethzero/MainWin.cpp
  2. 6
      exp/main.cpp
  3. 2
      libethereum/Executive.cpp
  4. 30
      libethereum/State.cpp

4
alethzero/MainWin.cpp

@ -344,8 +344,8 @@ void Main::onNewBlock()
refreshBlockChain(); refreshBlockChain();
refreshAccounts(); refreshAccounts();
// We must update balances since we can't filter updates to basic accounts. // We must update balances since we can't filter updates to basic accounts.
refreshBalances(); refreshBalances();
} }
void Main::onNewPending() void Main::onNewPending()

6
exp/main.cpp

@ -78,7 +78,7 @@ int main()
#elif 0 #elif 0
int main() int main()
{ {
KeyPair u = KeyPair::create(); KeyPair u = KeyPair::create();
KeyPair cb = KeyPair::create(); KeyPair cb = KeyPair::create();
OverlayDB db; OverlayDB db;
State s(cb.address(), db, BaseState::Empty); State s(cb.address(), db, BaseState::Empty);
@ -98,8 +98,8 @@ int main()
#else #else
int main() int main()
{ {
cnote << KeyPair(Secret("0000000000000000000000000000000000000000000000000000000000000000")).address(); cnote << KeyPair(Secret("0000000000000000000000000000000000000000000000000000000000000000")).address();
cnote << KeyPair(Secret("1111111111111111111111111111111111111111111111111111111111111111")).address(); cnote << KeyPair(Secret("1111111111111111111111111111111111111111111111111111111111111111")).address();
} }
#endif #endif

2
libethereum/Executive.cpp

@ -35,7 +35,7 @@ using namespace dev::eth;
Executive::Executive(State& _s, BlockChain const& _bc, unsigned _level): Executive::Executive(State& _s, BlockChain const& _bc, unsigned _level):
m_s(_s), m_s(_s),
m_lastHashes(_s.getLastHashes(_bc, (unsigned)_s.info().number - 1)), m_lastHashes(_s.getLastHashes(_bc, (unsigned)_s.info().number - 1)),
m_depth(_level) m_depth(_level)
{} {}

30
libethereum/State.cpp

@ -418,7 +418,7 @@ TransactionReceipts State::sync(BlockChain const& _bc, TransactionQueue& _tq, bo
TransactionReceipts ret; TransactionReceipts ret;
auto ts = _tq.transactions(); auto ts = _tq.transactions();
auto lh = getLastHashes(_bc, _bc.number()); auto lh = getLastHashes(_bc, _bc.number());
for (int goodTxs = 1; goodTxs;) for (int goodTxs = 1; goodTxs;)
{ {
@ -498,7 +498,7 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, bool _checkNonce)
GenericTrieDB<MemoryDB> receiptsTrie(&rm); GenericTrieDB<MemoryDB> receiptsTrie(&rm);
receiptsTrie.init(); receiptsTrie.init();
LastHashes lh = getLastHashes(_bc, (unsigned)m_previousBlock.number); LastHashes lh = getLastHashes(_bc, (unsigned)m_previousBlock.number);
// All ok with the block generally. Play back the transactions now... // All ok with the block generally. Play back the transactions now...
unsigned i = 0; unsigned i = 0;
@ -527,7 +527,7 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, bool _checkNonce)
cwarn << "Bad receipts state root."; cwarn << "Bad receipts state root.";
cwarn << "Block:" << toHex(_block); cwarn << "Block:" << toHex(_block);
cwarn << "Block RLP:" << RLP(_block); cwarn << "Block RLP:" << RLP(_block);
cwarn << "Calculated: " << receiptsTrie.root(); cwarn << "Calculated: " << receiptsTrie.root();
for (unsigned j = 0; j < i; ++j) for (unsigned j = 0; j < i; ++j)
{ {
RLPStream k; RLPStream k;
@ -539,15 +539,15 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, bool _checkNonce)
cwarn << TransactionReceipt(&b); cwarn << TransactionReceipt(&b);
} }
cwarn << "Recorded: " << m_currentBlock.receiptsRoot; cwarn << "Recorded: " << m_currentBlock.receiptsRoot;
auto rs = _bc.receipts(bi.hash); auto rs = _bc.receipts(bi.hash);
for (unsigned j = 0; j < rs.receipts.size(); ++j) for (unsigned j = 0; j < rs.receipts.size(); ++j)
{ {
auto b = rs.receipts[j].rlp(); auto b = rs.receipts[j].rlp();
cwarn << j << ": "; cwarn << j << ": ";
cwarn << "RLP: " << RLP(b); cwarn << "RLP: " << RLP(b);
cwarn << "Hex: " << toHex(b); cwarn << "Hex: " << toHex(b);
cwarn << rs.receipts[j]; cwarn << rs.receipts[j];
} }
BOOST_THROW_EXCEPTION(InvalidReceiptsStateRoot()); BOOST_THROW_EXCEPTION(InvalidReceiptsStateRoot());
} }
@ -1016,7 +1016,7 @@ LastHashes State::getLastHashes(BlockChain const& _bc, unsigned _n) const
ret.resize(256); ret.resize(256);
if (c_protocolVersion > 49) if (c_protocolVersion > 49)
{ {
ret[0] = _bc.numberHash(_n); ret[0] = _bc.numberHash(_n);
for (unsigned i = 1; i < 256; ++i) for (unsigned i = 1; i < 256; ++i)
ret[i] = ret[i - 1] ? _bc.details(ret[i - 1]).parent : h256(); ret[i] = ret[i - 1] ? _bc.details(ret[i - 1]).parent : h256();
} }
@ -1025,12 +1025,12 @@ LastHashes State::getLastHashes(BlockChain const& _bc, unsigned _n) const
u256 State::execute(BlockChain const& _bc, bytes const& _rlp, bytes* o_output, bool _commit) u256 State::execute(BlockChain const& _bc, bytes const& _rlp, bytes* o_output, bool _commit)
{ {
return execute(getLastHashes(_bc, _bc.number()), &_rlp, o_output, _commit); return execute(getLastHashes(_bc, _bc.number()), &_rlp, o_output, _commit);
} }
u256 State::execute(BlockChain const& _bc, bytesConstRef _rlp, bytes* o_output, bool _commit) u256 State::execute(BlockChain const& _bc, bytesConstRef _rlp, bytes* o_output, bool _commit)
{ {
return execute(getLastHashes(_bc, _bc.number()), _rlp, o_output, _commit); return execute(getLastHashes(_bc, _bc.number()), _rlp, o_output, _commit);
} }
// TODO: maintain node overlay revisions for stateroots -> each commit gives a stateroot + OverlayDB; allow overlay copying for rewind operations. // TODO: maintain node overlay revisions for stateroots -> each commit gives a stateroot + OverlayDB; allow overlay copying for rewind operations.

Loading…
Cancel
Save