HomePhabricator

Get rid of ambiguous OutputType::NONE value

Authored by Russell Yanofsky <russ@yanofsky.org> on Mar 19 2018, 19:57.

Description

Get rid of ambiguous OutputType::NONE value

Summary:
Based on suggestion by Pieter Wuille <pieter.wuille@gmail.com> at
https://github.com/bitcoin/bitcoin/pull/12119#issuecomment-357982763

After #12119, the NONE output type was overloaded to refer to either an output
type that couldn't be parsed, or to an automatic change output mode. This
change drops the NONE enum and uses a simple bool indicate parse failure, and a
new CHANGE_AUTO enum to refer the change output type.

This change is almost a pure refactoring except it makes RPCs reject empty
string ("") address types instead of treating them like they were unset. This
simplifies the parsing code a little bit and could prevent RPC usage mistakes.
It's noted in the release notes.

This is a backprt of Core PR12729

Test Plan:

make check

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

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

Details

Committed
deadalnixNov 12 2019, 00:33
Pushed
deadalnixNov 12 2019, 00:33
Reviewer
Restricted Project
Differential Revision
D4423: Get rid of ambiguous OutputType::NONE value
Parents
rABC28f918df531c: Fix unecessary copies in rpcwallet.cpp
Branches
Unknown
Tags
Unknown