Browse Source

Fixes for the latest LOG stuff.

cl-refactor
Gav Wood 10 years ago
parent
commit
744470b731
  1. 1
      alethzero/MainWin.cpp
  2. 2
      libethcore/BlockInfo.cpp
  3. 2
      libethereum/BlockChain.cpp
  4. 20
      libethereum/State.cpp

1
alethzero/MainWin.cpp

@ -1227,6 +1227,7 @@ void Main::on_blocks_currentItemChanged()
s << "<br/>Nonce: <b>" << info.nonce << "</b>";
s << "<br/>Parent: <b>" << info.parentHash << "</b>";
s << "<br/>Bloom: <b>" << details.bloom << "</b>";
s << "<br/>Log Bloom: <b>" << info.logBloom << "</b>";
s << "<br/>Transactions: <b>" << block[1].itemCount() << "</b> @<b>" << info.transactionsRoot << "</b>";
s << "<br/>Uncles: <b>" << block[2].itemCount() << "</b> @<b>" << info.sha3Uncles << "</b>";
if (info.parentHash)

2
libethcore/BlockInfo.cpp

@ -96,7 +96,7 @@ void BlockInfo::populateFromHeader(RLP const& _header, bool _checkNonce)
nonce = _header[field = 14].toHash<h256>();
}
catch (Exception & _e)
catch (Exception const& _e)
{
_e << errinfo_name("invalid block header format") << BadFieldError(field, toHex(_header[field].data().toBytes()));
throw;

2
libethereum/BlockChain.cpp

@ -101,7 +101,7 @@ bytes BlockChain::createGenesisBlock()
stateRoot = state.root();
}
block.appendList(13)
block.appendList(15)
// TODO: maybe make logbloom correct?
<< h256() << EmptySHA3 << h160() << stateRoot << EmptyTrie << EmptyTrie << LogBloom() << c_genesisDifficulty << 0 << 0 << 1000000 << 0 << (unsigned)0 << string() << sha3(bytes(1, 42));
block.appendRaw(RLPEmptyList);

20
libethereum/State.cpp

@ -817,8 +817,12 @@ void State::commitToMine(BlockChain const& _bc)
}
MemoryDB tm;
GenericTrieDB<MemoryDB> receipts(&tm);
receipts.init();
GenericTrieDB<MemoryDB> transactionsTrie(&tm);
transactionsTrie.init();
MemoryDB rm;
GenericTrieDB<MemoryDB> receiptsTrie(&rm);
receiptsTrie.init();
RLPStream txs;
txs.appendList(m_transactions.size());
@ -827,12 +831,15 @@ void State::commitToMine(BlockChain const& _bc)
{
RLPStream k;
k << i;
RLPStream v;
m_receipts[i].streamRLP(v);
receipts.insert(&k.out(), &v.out());
RLPStream receiptrlp;
m_receipts[i].streamRLP(receiptrlp);
receiptsTrie.insert(&k.out(), &receiptrlp.out());
RLPStream txrlp;
m_transactions[i].streamRLP(txrlp);
transactionsTrie.insert(&k.out(), &txrlp.out());
txs.appendRaw(txrlp.out());
}
@ -840,7 +847,8 @@ void State::commitToMine(BlockChain const& _bc)
RLPStream(unclesCount).appendRaw(unclesData.out(), unclesCount).swapOut(m_currentUncles);
m_currentBlock.receiptsRoot = receipts.root();
m_currentBlock.transactionsRoot = transactionsTrie.root();
m_currentBlock.receiptsRoot = receiptsTrie.root();
m_currentBlock.logBloom = logBloom();
m_currentBlock.sha3Uncles = sha3(m_currentUncles);

Loading…
Cancel
Save