|
|
@ -131,17 +131,22 @@ void EthereumHost::maintainTransactions(TransactionQueue& _tq, h256 _currentHash |
|
|
|
{ |
|
|
|
bool resendAll = (_currentHash != m_latestBlockSent); |
|
|
|
|
|
|
|
{ |
|
|
|
lock_guard<recursive_mutex> l(m_incomingLock); |
|
|
|
for (auto it = m_incomingTransactions.begin(); it != m_incomingTransactions.end(); ++it) |
|
|
|
if (_tq.import(&*it)) |
|
|
|
{}//ret = true; // just putting a transaction in the queue isn't enough to change the state - it might have an invalid nonce...
|
|
|
|
else |
|
|
|
m_transactionsSent.insert(sha3(*it)); // if we already had the transaction, then don't bother sending it on.
|
|
|
|
m_incomingTransactions.clear(); |
|
|
|
} |
|
|
|
|
|
|
|
// Send any new transactions.
|
|
|
|
for (auto const& p: peers()) |
|
|
|
{ |
|
|
|
auto ep = p->cap<EthereumPeer>(); |
|
|
|
if (ep) |
|
|
|
{ |
|
|
|
bytes b; |
|
|
|
unsigned n = 0; |
|
|
|
for (auto const& i: _tq.transactions()) |
|
|
@ -151,6 +156,8 @@ void EthereumHost::maintainTransactions(TransactionQueue& _tq, h256 _currentHash |
|
|
|
++n; |
|
|
|
m_transactionsSent.insert(i.first); |
|
|
|
} |
|
|
|
ep->clearKnownTransactions(); |
|
|
|
|
|
|
|
if (n) |
|
|
|
{ |
|
|
|
RLPStream ts; |
|
|
@ -160,10 +167,10 @@ void EthereumHost::maintainTransactions(TransactionQueue& _tq, h256 _currentHash |
|
|
|
seal(b); |
|
|
|
ep->send(&b); |
|
|
|
} |
|
|
|
ep->m_knownTransactions.clear(); |
|
|
|
ep->m_requireTransactions = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void EthereumHost::maintainBlocks(BlockQueue& _bq, h256 _currentHash) |
|
|
|
{ |
|
|
|