Skip to content

Minor optimization in `OP_CHECKDATASIG*`; avoid an extra copy + allocation

Summary

While working on !1827, I noticed this slight inefficiency in the OP_CHECKDATASIG* code. It writes the sighash to a temporary vector, before copying to a uint256 for the call to VerifySignature()

This commit just avoids the extra write to the vector, which is not needed, and has the hasher write directly to the destination uint256, avoiding extra copying.

No changes to the behavior of the code are caused by this commit, other than avoiding extra redundant copies. This is purely a code quality commit.

Test Plan

  • Review
  • ninja all check-all

Merge request reports