HomePhabricator

Refactor ParseScript to deduplicate error checking.

Description

Refactor ParseScript to deduplicate error checking.

Summary: This is extracted from D1295 . Refactoring the control flow and adding more logic make it fairly hard to review so this makes for a nice first step.

Test Plan:

make check

Reviewers: #bitcoin_abc, jasonbcox, schancel

Reviewed By: #bitcoin_abc, jasonbcox, schancel

Subscribers: jasonbcox, teamcity

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