MCPcopy Create free account
hub / github.com/LUX-Core/lux / syncTransactionQueue

Method syncTransactionQueue

src/cpp-ethereum/libethereum/Client.cpp:420–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420void Client::syncTransactionQueue()
421{
422 Timer timer;
423
424 h256Hash changeds;
425 TransactionReceipts newPendingReceipts;
426
427 DEV_WRITE_GUARDED(x_working)
428 {
429 if (m_working.isSealed())
430 {
431 ctrace << "Skipping txq sync for a sealed block.";
432 return;
433 }
434
435 tie(newPendingReceipts, m_syncTransactionQueue) = m_working.sync(bc(), m_tq, *m_gp);
436 }
437
438 if (newPendingReceipts.empty())
439 {
440 auto s = m_tq.status();
441 ctrace << "No transactions to process. " << m_working.pending().size() << " pending, " << s.current << " queued, " << s.future << " future, " << s.unverified << " unverified";
442 return;
443 }
444
445 DEV_READ_GUARDED(x_working)
446 DEV_WRITE_GUARDED(x_postSeal)
447 m_postSeal = m_working;
448
449 DEV_READ_GUARDED(x_postSeal)
450 for (size_t i = 0; i < newPendingReceipts.size(); i++)
451 appendFromNewPending(newPendingReceipts[i], changeds, m_postSeal.pending()[i].sha3());
452
453 // Tell farm about new transaction (i.e. restart mining).
454 onPostStateChanged();
455
456 // Tell watches about the new transactions.
457 noteChanged(changeds);
458
459 // Tell network about the new transactions.
460 if (auto h = m_host.lock())
461 h->noteNewTransactions();
462
463 ctrace << "Processed " << newPendingReceipts.size() << " transactions in" << (timer.elapsed() * 1000) << "(" << (bool)m_syncTransactionQueue << ")";
464}
465
466void Client::onDeadBlocks(h256s const& _blocks, h256Hash& io_changed)
467{

Callers

nothing calls this directly

Calls 10

pendingMethod · 0.80
lockMethod · 0.80
noteNewTransactionsMethod · 0.80
elapsedMethod · 0.80
DEV_READ_GUARDEDFunction · 0.70
DEV_WRITE_GUARDEDFunction · 0.70
emptyMethod · 0.45
statusMethod · 0.45
sizeMethod · 0.45
sha3Method · 0.45

Tested by

no test coverage detected