error w/o segwit after fork

This commit is contained in:
Brannon King 2019-10-11 14:16:38 -06:00
parent b16356b927
commit 76e3d8861c

View file

@ -567,6 +567,8 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
// NOTE: If at some point we support pre-segwit miners post-segwit-activation, this needs to take segwit support into consideration
const bool fPreSegWit = (ThresholdState::ACTIVE != VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT, versionbitscache));
if (!fPreSegWit && !fSupportsSegwit)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Segwit support is now required. Please include \"segwit\" in the client's rules.");
UniValue aCaps(UniValue::VARR); aCaps.push_back("proposal");
UniValue result(UniValue::VOBJ);
@ -585,7 +587,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
UniValue entry(UniValue::VOBJ);
entry.pushKV("data", EncodeHexTx(tx, fSupportsSegwit ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS));
entry.pushKV("data", EncodeHexTx(tx));
entry.pushKV("txid", txHash.GetHex());
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
@ -621,7 +623,6 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
aMutable.push_back("time");
aMutable.push_back("transactions");
aMutable.push_back("prevblock");
aMutable.push_back("submit/coinbase");
result.pushKV("capabilities", aCaps);