HomePhabricator

Allow ConvertBits() to succeed on unpadded zeros

Description

Allow ConvertBits() to succeed on unpadded zeros

Summary:
The behavior of ConvertBits() has been simplified in D572 from it's
original form, and would return false when there is any remaining bit
and padding is disabled.
This diff relaxes this requirement to be in par with the original
behavior (see
https://github.com/bitcoin/bitcoin/pull/11167/files#diff-b5877ad42a7dbee9a99cbf0596977fd9).
The call will now returns true if the remaining bits are all zeros.
This is a prerequisite for backporting PR11630.

The cash address decoding is updated to now check the output of
ConvertBits()

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
FabienAuthored on Apr 15 2020, 08:41
nakihitoPushed on Apr 16 2020, 19:29
Reviewer
Restricted Project
Differential Revision
D5734: Allow ConvertBits() to succeed on unpadded zeros
Parents
rSTAGINGeb3223a6e3af: qt: Set AA_EnableHighDpiScaling attribute early
Branches
Unknown
Tags
Unknown