Skip to content

Commit 3bf1e80

Browse files
authored
Merge pull request #168 from jtimon/e13-document-options
Document -signblockscript and -fedpegscript in daemon help
2 parents 211dba2 + b663091 commit 3bf1e80

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/init.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ std::string HelpMessage(HelpMessageMode mode)
403403
strUsage += HelpMessageOpt("-uacomment=<cmt>", _("Append comment to the user agent string"));
404404
if (showDebug)
405405
{
406+
strUsage += HelpMessageOpt("-signblockscript=<hex>", _("Change chain to be signed and validated with a different script.") +
407+
" " + _(" This creates a new chain with a different genesis block."));
406408
strUsage += HelpMessageOpt("-checkblockindex", strprintf("Do a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive and mapBlocksUnlinked occasionally. Also sets -checkmempool (default: %u)", defaultChainParams->DefaultConsistencyChecks()));
407409
strUsage += HelpMessageOpt("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u)", defaultChainParams->DefaultConsistencyChecks()));
408410
strUsage += HelpMessageOpt("-checkpoints", strprintf("Disable expensive verification for known chain history (default: %u)", DEFAULT_CHECKPOINTS_ENABLED));
@@ -482,6 +484,13 @@ std::string HelpMessage(HelpMessageMode mode)
482484
strUsage += HelpMessageOpt("-rpcservertimeout=<n>", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_SERVER_TIMEOUT));
483485
}
484486

487+
strUsage += HelpMessageGroup(_("Federated peg options:"));
488+
if (showDebug) {
489+
strUsage += HelpMessageOpt("-fedpegscript=<hex>", _("Change federated peg to use a different script.") +
490+
" " + _("This creates a new chain with a different genesis block."));
491+
}
492+
strUsage += HelpMessageOpt("-validatepegin", strprintf(_("Validate pegin claims. All functionaries must run this. (default: %u)"), DEFAULT_VALIDATE_PEGIN));
493+
485494
return strUsage;
486495
}
487496

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2944,7 +2944,7 @@ bool BitcoindRPCCheck(const bool init)
29442944
pblocktree->WriteInvalidBlockQueue(vblocksToReconsider);
29452945

29462946
//Next, check for working rpc
2947-
if (GetBoolArg("-validatepegin", false)) {
2947+
if (GetBoolArg("-validatepegin", DEFAULT_VALIDATE_PEGIN)) {
29482948
// During init try until a non-RPC_IN_WARMUP result
29492949
while (true) {
29502950
try {

src/script/interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
15801580
return set_error(serror, SCRIPT_ERR_WITHDRAW_VERIFY_OUTPUT_SCRIPT);
15811581

15821582
#ifndef BITCOIN_SCRIPT_NO_CALLRPC
1583-
if (GetBoolArg("-validatepegin", false) && !checker.IsConfirmedBitcoinBlock(genesishash, merkleBlock.header.GetHash(), flags & SCRIPT_VERIFY_INCREASE_CONFIRMATIONS_REQUIRED))
1583+
if (GetBoolArg("-validatepegin", DEFAULT_VALIDATE_PEGIN) && !checker.IsConfirmedBitcoinBlock(genesishash, merkleBlock.header.GetHash(), flags & SCRIPT_VERIFY_INCREASE_CONFIRMATIONS_REQUIRED))
15841584
return set_error(serror, SCRIPT_ERR_WITHDRAW_VERIFY_BLOCKCONFIRMED);
15851585
#endif
15861586
} catch (std::exception& e) {

src/script/script.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ static const int MAX_OPS_PER_SCRIPT = 201;
2727
// Maximum number of public keys per multisig
2828
static const int MAX_PUBKEYS_PER_MULTISIG = 20;
2929

30+
// Validate pegin proof by checking Bitcoin transaction inclusion in
31+
// mainchain.
32+
static const bool DEFAULT_VALIDATE_PEGIN = false;
33+
3034
// Maximum script length in bytes
3135
static const int MAX_SCRIPT_SIZE = 10000;
3236
class uint256;

0 commit comments

Comments
 (0)