| 418 | } |
| 419 | |
| 420 | void 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 | |
| 466 | void Client::onDeadBlocks(h256s const& _blocks, h256Hash& io_changed) |
| 467 | { |
nothing calls this directly
no test coverage detected