Page MenuHomePhabricator

wallet: Do not turn OP_1NEGATE in scriptSig into 0x0181 in signing code
AbandonedPublic

Authored by PiRK on Sep 9 2021, 13:17.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

A rebase of #13084 which additionally modifies the test code (unaddressed in the original, assuming sipa is too busy to deal with this at the moment).

Relatively simple bugfix so it'd be good to have merged soon.

Turning OP_1NEGATE into 0x0181 results in a larger-than-necessary data push instead of just actually using the OP_1NEGATE opcode (0x4f). This fails the minimal push rule of BIP 62 and makes the result non-standard.

This is a backport of core#17204

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Sep 9 2021, 13:17
PiRK planned changes to this revision.Sep 9 2021, 16:36

Needs more investigation to make sure it fits with our codebase

This does not seem apply to Bitcoin ABC. The included functional test works even without the patch.