From b325a5c3b2053a45a8c841001be03cfad743c9ea Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 1 Jun 2015 15:43:55 +0200 Subject: [PATCH] Mutex guard m_fulls on eval() --- libethcore/EthashAux.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 06da22f98..4b546404a 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -240,8 +240,9 @@ Ethash::Result EthashAux::eval(BlockInfo const& _header, Nonce const& _nonce) Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) { - if (FullType dag = get()->m_fulls[_seedHash].lock()) - return dag->compute(_headerHash, _nonce); + DEV_GUARDED(get()->x_fulls) + if (FullType dag = get()->m_fulls[_seedHash].lock()) + return dag->compute(_headerHash, _nonce); DEV_IF_THROWS(return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce)) { return Ethash::Result{ ~h256(), h256() };