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

Function DEV_WRITE_GUARDED

src/cpp-ethereum/libethereum/BlockQueue.cpp:436–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434{
435 bool wasFull = false;
436 DEV_WRITE_GUARDED(m_lock)
437 {
438 DEV_INVARIANT_CHECK;
439 wasFull = knownFull();
440 if (m_drainingSet.empty())
441 {
442 m_drainingDifficulty = 0;
443 DEV_GUARDED(m_verification)
444 o_out = m_verified.dequeueMultiple(min<unsigned>(_max, m_verified.count()));
445
446 for (auto const& bs: o_out)
447 {
448 // TODO: @optimise use map<h256, bytes> rather than vector<bytes> & set<h256>.
449 auto h = bs.verified.info.hash();
450 m_drainingSet.insert(h);
451 m_drainingDifficulty += bs.verified.info.difficulty();
452 m_readySet.erase(h);
453 }
454 }
455 }
456 if (wasFull && !knownFull())
457 m_onRoomAvailable();
458}

Callers

nothing calls this directly

Calls 8

dequeueMultipleMethod · 0.80
difficultyMethod · 0.80
DEV_GUARDEDFunction · 0.70
emptyMethod · 0.45
countMethod · 0.45
hashMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected