@@ -274,8 +274,8 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
274274 // Preconditions.
275275 // ........................................................................
276276
277- const auto & block = message->block_ptr ;
278- const auto & hash = block-> get_hash ();
277+ const auto & block = message->block ;
278+ const auto hash = block. hash ();
279279 const auto it = map_->find (hash);
280280 auto & query = archive ();
281281
@@ -300,15 +300,15 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
300300 // only stored when a strong header has been stored, later to be found out
301301 // as invalid and not malleable. Stored invalidity prevents repeat
302302 // processing of the same invalid chain but is not necessary or desirable.
303- if (const auto code = check (* block, it->context , bypass))
303+ if (const auto code = check (block, it->context , bypass))
304304 {
305305 if (code == system::error::invalid_transaction_commitment ||
306306 code == system::error::invalid_witness_commitment)
307307 {
308308 LOGR (" Malleated block [" << encode_hash (hash) << " :" << height
309309 << " ] from [" << opposite () << " ] " << code.message ()
310- << " txs(" << block-> transactions () << " )"
311- << " segregated(" << block-> is_segregated () << " )." );
310+ << " txs(" << block. transactions () << " )"
311+ << " segregated(" << block. is_segregated () << " )." );
312312 stop (code);
313313 return false ;
314314 }
@@ -330,7 +330,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
330330 // Commit block.txs.
331331 // ........................................................................
332332
333- if (const auto code = query.set_code (* block, link, checked, bypass, height))
333+ if (const auto code = query.set_code (block, link, checked, bypass, height))
334334 {
335335 LOGF (" Failure storing block [" << encode_hash (hash) << " :" << height
336336 << " ] from [" << opposite () << " ] " << code.message ());
@@ -348,7 +348,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
348348 notify (ec, chase::checked, height);
349349 fire (events::block_archived, height);
350350
351- count (block-> serialized_size (true ));
351+ count (block. serialized_size (true ));
352352 map_->erase (it);
353353 if (is_idle ())
354354 {
@@ -359,10 +359,10 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
359359 return true ;
360360}
361361
362- // Identity is correct unless error::invalid_witness_commitment or
363- // error::invalid_transaction_commitment is returned. Only identity is required
364- // under bypass. Header state is checked by organize.
365- code protocol_block_in_31800::check (const chain::block & block,
362+ // Header is checked by organize, Check/Accept/Connect are called by validate.
363+ // While check could be called here, it's more optimal to defer to validate, as
364+ // requiring only identity here allows the use of the simplified block_view.
365+ code protocol_block_in_31800::check (const chain::block_view & block,
366366 const chain::context& ctx, bool ) const NOEXCEPT
367367{
368368 code ec{};
0 commit comments