/// Get some infomration on the given block's status regarding us.
/// Get some infomration on the given block's status regarding us.
QueueStatusblockStatus(h256const&_h)const;
QueueStatusblockStatus(h256const&_h)const;
@ -106,15 +114,25 @@ private:
boolinvariants()constoverride;
boolinvariants()constoverride;
mutableboost::shared_mutexm_lock;///< General lock.
voidverifierBody();
mutableboost::shared_mutexm_lock;///< General lock for the sets, m_future and m_unknown.
h256Hashm_drainingSet;///< All blocks being imported.
h256Hashm_drainingSet;///< All blocks being imported.
h256Hashm_readySet;///< All blocks ready for chain-import.
h256Hashm_readySet;///< All blocks ready for chain import.
std::vector<std::pair<h256,bytes>>m_ready;///< List of blocks, in correct order, ready for chain-import.
h256Hashm_unknownSet;///< Set of all blocks whose parents are not ready/in-chain.
h256Hashm_unknownSet;///< Set of all blocks whose parents are not ready/in-chain.
std::unordered_multimap<h256,std::pair<h256,bytes>>m_unknown;///< For blocks that have an unknown parent; we map their parent hash to the block stuff, and insert once the block appears.
std::unordered_multimap<h256,std::pair<h256,bytes>>m_unknown;///< For blocks that have an unknown parent; we map their parent hash to the block stuff, and insert once the block appears.
h256Hashm_knownBad;///< Set of blocks that we know will never be valid.
h256Hashm_knownBad;///< Set of blocks that we know will never be valid.
std::multimap<unsigned,std::pair<h256,bytes>>m_future;///< Set of blocks that are not yet valid. Ordered by timestamp
std::multimap<unsigned,std::pair<h256,bytes>>m_future;///< Set of blocks that are not yet valid. Ordered by timestamp
Signalm_onReady;///< Called when a subsequent call to import blocks will return a non-empty container. Be nice and exit fast.
Signalm_onReady;///< Called when a subsequent call to import blocks will return a non-empty container. Be nice and exit fast.
mutableMutexm_verification;///< Mutex that allows writing to m_verified, m_verifying and m_unverified.
std::condition_variablem_moreToVerify;///< Signaled when m_unverified has a new entry.
std::vector<std::pair<BlockInfo,bytes>>m_verified;///< List of blocks, in correct order, verified and ready for chain-import.
std::deque<std::pair<BlockInfo,bytes>>m_verifying;///< List of blocks being verified; as long as the second component (bytes) is empty, it's not finished.
std::deque<std::pair<h256,bytes>>m_unverified;///< List of blocks, in correct order, ready for verification.
std::vector<std::thread>m_verifiers;///< Threads who only verify.
boolm_deleting=false;///< Exit condition for verifiers.
h256Hashm_known;///< Hashes of transactions in both sets.
h256Hashm_known;///< Hashes of transactions in both sets.
std::unordered_multimap<Address,h256>m_senders;///< Mapping from the sender address to the transaction hash; useful for determining the nonce of a given sender.
std::unordered_map<h256,Transaction>m_current;///< Map of SHA3(tx) to tx.
std::unordered_map<h256,Transaction>m_current;///< Map of SHA3(tx) to tx.
std::unordered_multimap<Address,std::pair<h256,Transaction>>m_unknown;///< For transactions that have a future nonce; we map their sender address to the tx stuff, and insert once the sender has a valid TX.
std::unordered_map<h256,Transaction>m_future;///< For transactions that have a future nonce; we re-insert into current once the sender has a valid TX.
std::unordered_map<h256,std::function<void(ImportResult)>>m_callbacks;///< Called once.
std::unordered_map<h256,std::function<void(ImportResult)>>m_callbacks;///< Called once.
h256Hashm_dropped;///< Transactions that have previously been dropped.
h256Hashm_dropped;///< Transactions that have previously been dropped.
std::multimap<Address,h256>m_senders;///< Mapping from the sender address to the transaction hash; useful for determining the nonce of a given sender.
Signalm_onReady;///< Called when a subsequent call to import transactions will return a non-empty container. Be nice and exit fast.
Signalm_onReady;///< Called when a subsequent call to import transactions will return a non-empty container. Be nice and exit fast.