@@ -702,24 +702,24 @@ bool block::is_unspent_coinbase_collision() const NOEXCEPT
702702}
703703
704704// Search is not ordered, forward references are caught by block.check.
705- bool block::populate () const NOEXCEPT
705+ bool block::populate (const chain::context& ctx ) const NOEXCEPT
706706{
707707 if (txs_->empty ())
708708 return true ;
709709
710+ const auto start = std::next (txs_->begin ());
711+ const auto bip68 = ctx.is_enabled (chain::flags::bip68_rule);
710712 unordered_map_of_cref_point_to_output_cptr_cref points{};
711- const auto second = std::next (txs_->begin ());
712- const auto last = txs_->end ();
713713 uint32_t index{};
714714
715715 // Populate outputs hash table.
716- for (auto tx = second ; tx != last ; ++tx, index = 0 )
716+ for (auto tx = start ; tx != txs_-> end () ; ++tx, index = 0 )
717717 for (const auto & out: *(*tx)->outputs_ptr ())
718718 points.emplace (cref_point{ (*tx)->get_hash (false ), index++ }, out);
719719
720720 // Populate input prevouts from hash table and obtain locked state.
721721 auto locked = false ;
722- for (auto tx = second ; tx != last ; ++tx)
722+ for (auto tx = start ; tx != txs_-> end () ; ++tx)
723723 {
724724 for (const auto & in: *(*tx)->inputs_ptr ())
725725 {
@@ -730,7 +730,7 @@ bool block::populate() const NOEXCEPT
730730 if (point != points.end ())
731731 {
732732 in->prevout = point->second ;
733- in->metadata .locked = in->is_internally_locked ();
733+ in->metadata .locked = bip68 && in->is_internally_locked ();
734734 locked |= in->metadata .locked ;
735735 }
736736 }
0 commit comments