@@ -43,6 +43,7 @@ chaser_validate::chaser_validate(full_node& node) NOEXCEPT
4343 subsidy_interval_(node.system_settings().subsidy_interval_blocks),
4444 initial_subsidy_(node.system_settings().initial_subsidy()),
4545 maximum_backlog_(node.node_settings().maximum_concurrency_()),
46+ batch_signatures_(node.node_settings().batch_signatures),
4647 node_witness_(node.network_settings().witness_node()),
4748 defer_(node.node_settings().defer_validation),
4849 filter_(!defer_ && node.archive().filter_enabled())
@@ -295,8 +296,51 @@ code chaser_validate::validate(bool bypass, const chain::block& block,
295296 if ((ec = block.accept (ctx, subsidy_interval_, initial_subsidy_)))
296297 return ec;
297298
298- if ((ec = block.connect (ctx)))
299- return ec;
299+ if (batch_signatures_)
300+ {
301+ const chain::signatures capture
302+ {
303+ .ecdsa = [&](const hash_digest& ,
304+ const ec_compressed& , const ec_signature& ) NOEXCEPT
305+ {
306+ // //query.set_signature(digest, point, sign, link);
307+ },
308+
309+ .schnorr = [&](const hash_digest& ,
310+ const ec_xonly& , const ec_signature& ) NOEXCEPT
311+ {
312+ // //query.set_signature(digest, point, sign, link);
313+ },
314+
315+ .enabled = batch_signatures_
316+ };
317+
318+ if ((ec = block.connect (ctx, capture)))
319+ return ec;
320+
321+ batched_ecdsa_ += capture.batched_ecdsa ;
322+ unbatched_ecdsa_ += capture.unbatched_ecdsa ;
323+ batched_schnorr_ += capture.batched_schnorr ;
324+ unbatched_schnorr_ += capture.unbatched_schnorr ;
325+ batched_multisig_ += capture.batched_multisig ;
326+ unbatched_multisig_ += capture.unbatched_multisig ;
327+ {
328+ LOGV (" Bypass ecdsa " << batched_ecdsa_ << " / (" << batched_ecdsa_ << " + " << unbatched_ecdsa_ << " )" );
329+ }
330+ if (to_bool (batched_schnorr_.load ()) || to_bool (unbatched_schnorr_.load ()))
331+ {
332+ LOGV (" Bypass schnorr " << batched_schnorr_ << " / (" << batched_schnorr_ << " + " << unbatched_schnorr_ << " )" );
333+ }
334+ if (to_bool (batched_multisig_.load ()) || to_bool (unbatched_multisig_.load ()))
335+ {
336+ LOGV (" Bypass multisig " << batched_multisig_ << " / (" << batched_multisig_ << " + " << unbatched_multisig_ << " )" );
337+ }
338+ }
339+ else
340+ {
341+ if ((ec = block.connect (ctx)))
342+ return ec;
343+ }
300344
301345 // Prevouts optimize confirmation.
302346 if (!query.set_prevouts (link, block))
0 commit comments