@@ -139,7 +139,7 @@ void CLASS::do_organize(typename Block::cptr block,
139139 return ;
140140 }
141141
142- const auto it = tree_.find (hash);
142+ const auto it = tree_.find (system::hash_cref ( hash) );
143143 if (it != tree_.end ())
144144 {
145145 handler (error_duplicate (), it->second .state ->height ());
@@ -448,7 +448,8 @@ TEMPLATE
448448void CLASS::cache (const typename Block::cptr& block,
449449 const chain_state::ptr& state) NOEXCEPT
450450{
451- tree_.insert ({ block->hash (), { block, state } });
451+ tree_.emplace (system::hash_cref (block->get_hash ()),
452+ block_state{ block, state });
452453}
453454
454455TEMPLATE
@@ -463,7 +464,7 @@ CLASS::chain_state::ptr CLASS::get_chain_state(
463464 return state_;
464465
465466 // Previous block may be cached because it is not yet strong.
466- const auto it = tree_.find (previous_hash);
467+ const auto it = tree_.find (system::hash_cref ( previous_hash) );
467468 if (it != tree_.end ())
468469 return it->second .state ;
469470
@@ -484,8 +485,8 @@ bool CLASS::get_branch_work(uint256_t& work, size_t& branch_point,
484485 work = header.proof ();
485486
486487 // Sum all branch work from tree.
487- for (auto it = tree_.find (*previous); it != tree_.end ();
488- it = tree_.find (*previous))
488+ for (auto it = tree_.find (system::hash_cref ( *previous) ); it != tree_.end ();
489+ it = tree_.find (system::hash_cref ( *previous) ))
489490 {
490491 const auto & next = get_header (*it->second .block );
491492 previous = &next.previous_block_hash ();
@@ -561,7 +562,7 @@ code CLASS::push_block(const Block& block,
561562TEMPLATE
562563code CLASS::push_block (const system::hash_digest& key) NOEXCEPT
563564{
564- const auto handle = tree_.extract (key);
565+ const auto handle = tree_.extract (system::hash_cref ( key) );
565566 if (!handle)
566567 return error::organize15;
567568
0 commit comments