|
@ -764,7 +764,7 @@ bool State::amIJustParanoid(BlockChain const& _bc) |
|
|
// Compile block:
|
|
|
// Compile block:
|
|
|
RLPStream block; |
|
|
RLPStream block; |
|
|
block.appendList(3); |
|
|
block.appendList(3); |
|
|
m_currentBlock.streamRLP(block, true); |
|
|
m_currentBlock.streamRLP(block, WithNonce); |
|
|
block.appendRaw(m_currentTxs); |
|
|
block.appendRaw(m_currentTxs); |
|
|
block.appendRaw(m_currentUncles); |
|
|
block.appendRaw(m_currentUncles); |
|
|
|
|
|
|
|
@ -831,7 +831,7 @@ void State::commitToMine(BlockChain const& _bc) |
|
|
if (!knownUncles.count(u)) // ignore any uncles/mainline blocks that we know about.
|
|
|
if (!knownUncles.count(u)) // ignore any uncles/mainline blocks that we know about.
|
|
|
{ |
|
|
{ |
|
|
BlockInfo ubi(_bc.block(u)); |
|
|
BlockInfo ubi(_bc.block(u)); |
|
|
ubi.streamRLP(unclesData, true); |
|
|
ubi.streamRLP(unclesData, WithNonce); |
|
|
++unclesCount; |
|
|
++unclesCount; |
|
|
uncleAddresses.push_back(ubi.coinbaseAddress); |
|
|
uncleAddresses.push_back(ubi.coinbaseAddress); |
|
|
} |
|
|
} |
|
@ -895,13 +895,13 @@ MineInfo State::mine(unsigned _msTimeout, bool _turbo) |
|
|
m_currentBlock.difficulty = m_currentBlock.calculateDifficulty(m_previousBlock); |
|
|
m_currentBlock.difficulty = m_currentBlock.calculateDifficulty(m_previousBlock); |
|
|
|
|
|
|
|
|
// TODO: Miner class that keeps dagger between mine calls (or just non-polling mining).
|
|
|
// TODO: Miner class that keeps dagger between mine calls (or just non-polling mining).
|
|
|
auto ret = m_pow.mine(/*out*/m_currentBlock.nonce, m_currentBlock.headerHashWithoutNonce(), m_currentBlock.difficulty, _msTimeout, true, _turbo); |
|
|
auto ret = m_pow.mine(/*out*/m_currentBlock.nonce, m_currentBlock.headerHash(WithoutNonce), m_currentBlock.difficulty, _msTimeout, true, _turbo); |
|
|
|
|
|
|
|
|
if (!ret.completed) |
|
|
if (!ret.completed) |
|
|
m_currentBytes.clear(); |
|
|
m_currentBytes.clear(); |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
cnote << "Completed" << m_currentBlock.headerHashWithoutNonce().abridged() << m_currentBlock.nonce.abridged() << m_currentBlock.difficulty << ProofOfWork::verify(m_currentBlock.headerHashWithoutNonce(), m_currentBlock.nonce, m_currentBlock.difficulty); |
|
|
cnote << "Completed" << m_currentBlock.headerHash(WithoutNonce).abridged() << m_currentBlock.nonce.abridged() << m_currentBlock.difficulty << ProofOfWork::verify(m_currentBlock.headerHash(WithoutNonce), m_currentBlock.nonce, m_currentBlock.difficulty); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return ret; |
|
|
return ret; |
|
@ -915,7 +915,7 @@ void State::completeMine() |
|
|
// Compile block:
|
|
|
// Compile block:
|
|
|
RLPStream ret; |
|
|
RLPStream ret; |
|
|
ret.appendList(3); |
|
|
ret.appendList(3); |
|
|
m_currentBlock.streamRLP(ret, true); |
|
|
m_currentBlock.streamRLP(ret, WithNonce); |
|
|
ret.appendRaw(m_currentTxs); |
|
|
ret.appendRaw(m_currentTxs); |
|
|
ret.appendRaw(m_currentUncles); |
|
|
ret.appendRaw(m_currentUncles); |
|
|
ret.swapOut(m_currentBytes); |
|
|
ret.swapOut(m_currentBytes); |
|
|