File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -704,17 +704,22 @@ bool block::is_unspent_coinbase_collision() const NOEXCEPT
704704// Search is not ordered, forward references are caught by block.check.
705705bool block::populate () const NOEXCEPT
706706{
707- uint32_t index{};
707+ if (txs_->empty ())
708+ return true ;
709+
708710 unordered_map_of_cref_point_to_output_cptr_cref points{};
711+ const auto second = std::next (txs_->begin ());
712+ const auto last = txs_->end ();
713+ uint32_t index{};
709714
710715 // Populate outputs hash table.
711- for (auto tx = txs_-> begin () ; tx != txs_-> end () ; ++tx, index = 0 )
716+ for (auto tx = second ; tx != last ; ++tx, index = 0 )
712717 for (const auto & out: *(*tx)->outputs_ptr ())
713718 points.emplace (cref_point{ (*tx)->get_hash (false ), index++ }, out);
714719
715720 // Populate input prevouts from hash table and obtain locked state.
716721 auto locked = false ;
717- for (auto tx = txs_-> begin () ; tx != txs_-> end () ; ++tx)
722+ for (auto tx = second ; tx != last ; ++tx)
718723 {
719724 for (const auto & in: *(*tx)->inputs_ptr ())
720725 {
You can’t perform that action at this time.
0 commit comments