Page MenuHomePhabricator

Fix a bug in ibd.sh where multiple args provided to the script would not be parsed correctly
ClosedPublic

Authored by jasonbcox on Mar 2 2019, 00:18.

Details

Summary

Discovered while doing additional testing on ibd.sh after D2612. Initially introduced in D2027.
Ordering of the arguments and whether or not those args contain = impacts the final args interpretted by bitcoind.
The quotes cause the args to be interpretted as a single arg with the value inside the quotes. In this case, without
the below patch, passing the follow args gives the following results due to the string being evaluated as a single argument:
ibd.sh -assumvalid=0 -checkpoints=0 -disablewallet
assumevalid = 0 -checkpoints=0 -disablewallet
Assumevalid gets set to some hex based on the above string.
Checkpoints remains enabled by default.
Wallet is enabled by default.

ibd.sh -disablewallet -assumvalid=0 -checkpoints=0
disablewallet assumevalid = 0 checkpoints=0
Wallet, assumevalid, and checkpoints all remain at their default values.

Test Plan

Add a log message to check for fCheckpointsEnabled value in init.cpp for sanity. (not included in this patch)

cd build/
../../contrib/teamcity/ibd.sh -assumevalid=0 -checkpoints=0 -disablewallet
less ibd/debug.log

Ensure that messages for assumevalid, checkpoints, and wallet indicate they are all disabled.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ibd
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5122
Build 8307: Bitcoin ABC Buildbot (legacy)
Build 8306: arc lint + arc unit

Event Timeline

jasonbcox edited the summary of this revision. (Show Details)

https://reviews.bitcoinabc.org/T545

This explains why I couldn't replicate this bug. Everything seemed to have been working fine earlier, but turns out if you change the order the options are input then it changes which flags are actually toggled on/off. I should have paid more attention to exactly how I was inputting the options when running the script.

This revision is now accepted and ready to land.Mar 2 2019, 00:44
This revision was automatically updated to reflect the committed changes.