Debugging

This commit is contained in:
miketout
2018-10-03 22:04:39 -07:00
parent dc5e6137c7
commit 2ed3bbec38
3 changed files with 15 additions and 2 deletions

View File

@@ -1014,7 +1014,8 @@ bool ContextualCheckTransaction(
// If Sprout rules apply, reject transactions which are intended for Overwinter and beyond
if (isSprout && tx.fOverwintered) {
return state.DoS(isInitBlockDownload() ? 0 : dosLevel,
error("ContextualCheckTransaction(): overwinter is not active yet"),
error("ContextualCheckTransaction(): ht.%d activates.%d dosLevel.%d overwinter is not active yet",
nHeight, Params().GetConsensus().vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight, dosLevel),
REJECT_INVALID, "tx-overwinter-not-active");
}

View File

@@ -1495,9 +1495,15 @@ bool VerifyScript(
// serror is set
return false;
if (stack.empty())
{
//printf("interpreter stack is empty, comment this debugging message\nscriptSig: %s\nscriptPubKey: %s",scriptSig.ToString().c_str(),scriptPubKey.ToString().c_str());
return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
}
if (CastToBool(stack.back()) == false)
{
//printf("false return value, comment this debugging message\nscriptSig: %s\nscriptPubKey: %s",scriptSig.ToString().c_str(),scriptPubKey.ToString().c_str());
return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
}
// Additional validation for spend-to-script-hash transactions:
if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash())
@@ -1522,9 +1528,15 @@ bool VerifyScript(
// serror is set
return false;
if (stack.empty())
{
//printf("interpreter stack is empty #2, comment this debugging message\nscriptSig: %s\nscriptPubKey: %s",scriptSig.ToString().c_str(),scriptPubKey.ToString().c_str());
return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
}
if (!CastToBool(stack.back()))
{
//printf("false return value #2, comment this debugging message\nscriptSig: %s\nscriptPubKey: %s",scriptSig.ToString().c_str(),scriptPubKey.ToString().c_str());
return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
}
}
// The CLEANSTACK check is only performed after potential P2SH evaluation,

View File

@@ -3457,7 +3457,7 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp)
bool allowSapling = (Params().GetConsensus().vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight <= chainActive.LastTip()->GetHeight());
std::string defaultType = allowSapling ? ADDR_TYPE_SAPLING : ADDR_TYPE_SPROUT;
std::string defaultType = ADDR_TYPE_SPROUT;
if (fHelp || params.size() > 1)
throw runtime_error(