Page MenuHomePhabricator

rpc: require second argument only for scantxoutset start action
ClosedPublic

Authored by PiRK on Nov 9 2020, 11:13.

Details

Summary

The second argument of scanobjects is only required for the start action. Stop and abort actions did not and could work without them.

It appears that this was broken by #16240 which enforced the size of the arguments to match the listed required arguments.

To fix this issue, this PR makes the scanobjects argument an optional argument. Then only in the start action do we check whether the scanobjects argument is there and throw an informative error about that. Also a test is added for this case.

This is a backport of Core PR17728

Test Plan

ninja && ./test/functional/test_runner.py rpc_scantxoutset

In one terminal window, run:
bitcoin-cli scantxoutset start "[\"addr(1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2)\"]"

In another terminal, check that the two following commands work:

bitcoin-cli scantxoutset status
bitcoin-cli scantxoutset abort

Diff Detail