@@ -117,12 +117,11 @@ code chaser_block::validate(const block& block,
117117 return ec;
118118 }
119119
120- // Populate prevouts from self/tree (metadata not required).
121- if (!populate (block, ctx))
122- return system::error::relative_time_locked;
120+ // Populate prevouts from self/tree (no metadata for accept/connect).
121+ populate (block);
123122
124- // Populate prevouts from store (metadata not required ).
125- if (!archive ().populate (block))
123+ // Populate prevouts from store (no metadata for accept/connect ).
124+ if (!archive ().populate_without_metadata (block))
126125 return network::error::protocol_violation;
127126
128127 if ((ec = block.accept (ctx,
@@ -156,6 +155,8 @@ void chaser_block::update_milestone(const header&, size_t, size_t) NOEXCEPT
156155void chaser_block::set_prevout (const input& input) const NOEXCEPT
157156{
158157 const auto & point = input.point ();
158+ if (input.prevout || point.is_null ())
159+ return ;
159160
160161 // Scan all tree blocks for matching tx (linear :/ but legacy scenario)
161162 std::for_each (tree ().begin (), tree ().end (), [&](const auto & item) NOEXCEPT
@@ -173,25 +174,22 @@ void chaser_block::set_prevout(const input& input) const NOEXCEPT
173174 const outputs_cptr outs{ tx->outputs_ptr () };
174175 if (point.index () < outs->size ())
175176 {
177+ // prevout is mutable so can be set on a const object.
176178 input.prevout = outs->at (point.index ());
177179 return ;
178180 }
179181 }
180182 });
181183}
182184
183- // metadata is mutable so can be set on a const object.
184- bool chaser_block::populate (const block& block,
185- const system::chain::context& ctx) const NOEXCEPT
185+ bool chaser_block::populate (const block& block) const NOEXCEPT
186186{
187- if (!block.populate (ctx))
188- return false ;
187+ block.populate ();
189188
190- const inputs_cptr ins{ block.inputs_ptr () } ;
191- std::for_each (ins-> begin (), ins-> end (), [&](const auto & in) NOEXCEPT
189+ const auto & ins = * block.inputs_ptr ();
190+ std::for_each (ins. begin (), ins. end (), [&](const auto & in) NOEXCEPT
192191 {
193- if (!in->prevout && !in->point ().is_null ())
194- set_prevout (*in);
192+ set_prevout (*in);
195193 });
196194
197195 return true ;
0 commit comments