| 123 | } |
| 124 | |
| 125 | bool replace(h256 const& _hash, T&& _t) |
| 126 | { |
| 127 | auto const it = std::find_if(m_queue.begin(), m_queue.end(), sha3UnclesEquals(_hash)); |
| 128 | |
| 129 | if (it == m_queue.end()) |
| 130 | return false; |
| 131 | |
| 132 | m_size -= it->blockData.size(); |
| 133 | m_size += _t.blockData.size(); |
| 134 | *it = std::move(_t); |
| 135 | |
| 136 | return true; |
| 137 | } |
| 138 | |
| 139 | private: |
| 140 | static std::function<bool(T const&)> sha3UnclesEquals(h256 const& _hash) |