Browse Source

Fix mining.

Fix stdserv.js.
cl-refactor
Gav Wood 10 years ago
parent
commit
3896eb55d0
  1. 6
      libethcore/BlockInfo.cpp
  2. 4
      libp2p/Host.cpp
  3. 2
      stdserv.js

6
libethcore/BlockInfo.cpp

@ -56,12 +56,12 @@ h256 BlockInfo::headerHashWithoutNonce() const
return sha3(s.out());
}
auto static const s_sha3EmptyList = sha3(RLPEmptyList);
auto static const c_sha3EmptyList = sha3(RLPEmptyList);
void BlockInfo::fillStream(RLPStream& _s, bool _nonce) const
{
_s.appendList(_nonce ? 13 : 12) << parentHash;
_s.append(sha3Uncles == s_sha3EmptyList ? h256() : sha3Uncles, false, true);
_s.append(sha3Uncles == c_sha3EmptyList ? h256() : sha3Uncles, false, true);
_s << coinbaseAddress;
_s.append(stateRoot, false, true).append(transactionsRoot, false, true);
_s << difficulty << number << minGasPrice << gasLimit << gasUsed << timestamp << extraData;
@ -83,6 +83,8 @@ void BlockInfo::populateFromHeader(RLP const& _header, bool _checkNonce)
{
parentHash = _header[field = 0].toHash<h256>();
sha3Uncles = _header[field = 1].toHash<h256>();
if (sha3Uncles == h256())
sha3Uncles = c_sha3EmptyList;
coinbaseAddress = _header[field = 2].toHash<Address>();
stateRoot = _header[field = 3].toHash<h256>();
transactionsRoot = _header[field = 4].toHash<h256>();

4
libp2p/Host.cpp

@ -375,7 +375,7 @@ shared_ptr<Node> Host::noteNode(NodeId _id, bi::tcp::endpoint _a, Origin _o, boo
_a = bi::tcp::endpoint(_a.address(), 0);
}
cnote << "Node:" << _id.abridged() << _a << (_ready ? "ready" : "used") << _oldId.abridged() << (m_nodes.count(_id) ? "[have]" : "[NEW]");
// cnote << "Node:" << _id.abridged() << _a << (_ready ? "ready" : "used") << _oldId.abridged() << (m_nodes.count(_id) ? "[have]" : "[NEW]");
// First check for another node with the same connection credentials, and put it in oldId if found.
if (!_oldId)
@ -422,7 +422,7 @@ shared_ptr<Node> Host::noteNode(NodeId _id, bi::tcp::endpoint _a, Origin _o, boo
else
m_private -= i;
cnote << m_nodes[_id]->index << ":" << m_ready;
// cnote << m_nodes[_id]->index << ":" << m_ready;
m_hadNewNodes = true;

2
stdserv.js

@ -280,7 +280,7 @@ env.note('Register my name...')
eth.transact({ 'to': nameReg, 'data': [ eth.fromAscii('register'), eth.fromAscii('Gav') ] });
env.note('Dole out ETH to other address...')
eth.transact({ 'value': '100000000000000000000', 'to': eth.secretToAddress(eth.keys[1]) });
eth.transact({ 'value': '100000000000000000000', 'to': eth.accounts[1] });
env.note('Register my other name...')
eth.transact({ 'from': eth.keys[1], 'to': nameReg, 'data': [ eth.fromAscii('register'), eth.fromAscii("Gav Would") ] });

Loading…
Cancel
Save