HomePhabricator

make pad_tx produce the correct size when possible

Description

make pad_tx produce the correct size when possible

Summary:
Previously, pad_tx was overpadding transactions by at least 1 byte. This was caused by at least 2 reasons:

  • the byte encoding the data length after the OP_RETURN was not taken into
  • the additional byte required by OP_PUSHDATA1 when the data length exceeded 0x4c was not taken into account

This is an attempt to make the resulting length match the required length in most situation.
Now, it should only differ in cases where the request size is less than one empty vout (10 bytes) above the current tx size.

Test Plan: ninja check-functional-extended

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10276

Details

Provenance
PiRKAuthored on Oct 6 2021, 16:31
PiRKPushed on Oct 11 2021, 07:23
Reviewer
Restricted Project
Differential Revision
D10276: make pad_tx produce the correct size when possible
Parents
rABC5fcbf32ac022: Rename SendMessage to SendZmqMessage.
Branches
Unknown
Tags
Unknown