@@ -291,13 +291,21 @@ bool protocol_native::handle_get_block_header_context(const code& ec,
291291 // The "state" element implies transactions are associated.
292292 if (query.is_associated (link))
293293 {
294+ size_t size{}, weight{};
295+ if (!query.get_block_sizes (size, weight, link))
296+ {
297+ send_internal_server_error (database::error::integrity);
298+ return true ;
299+ }
300+
294301 const auto check = system_settings ().top_checkpoint ().height ();
295302 const auto bypass = context.height < check || query.is_milestone (link);
303+
296304 object[" state" ] = boost::json::object
297305 {
306+ { " size" , size },
307+ { " weight" , weight },
298308 { " count" , query.get_tx_count (link) },
299- { " size" , query.get_block_size (link, true ) },
300- { " weight" , query.get_block_size (link, false ) },
301309 { " validated" , bypass || query.is_validated (link) },
302310 { " confirmed" , check || query.is_confirmed_block (link) },
303311 { " confirmable" , bypass || query.is_confirmable (link) },
@@ -708,8 +716,8 @@ bool protocol_native::handle_get_tx_details(const code& ec,
708716 const auto bip141 = context.is_enabled (chain::flags::bip141_rule);
709717 object[" confirmed" ] = boost::json::object
710718 {
711- { " height" , context.height },
712- { " position" , position },
719+ { " height" , context.height },
720+ { " position" , position },
713721 { " sigops" , tx->signature_operations (bip16, bip141) }
714722 };
715723 }
0 commit comments