ensure we don't return witness data in the transaction w/o segwit rule
This commit is contained in:
parent
b10163f1ce
commit
9252cbf32d
1 changed files with 2 additions and 2 deletions
|
@ -443,7 +443,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
|
|||
if (strMode != "template")
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode");
|
||||
|
||||
if (Params().NetworkIDString() != CBaseChainParams::REGTEST) // who should own this constant?
|
||||
if (Params().NetworkIDString() == CBaseChainParams::MAIN)
|
||||
{
|
||||
if (!g_connman)
|
||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||
|
@ -572,7 +572,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
|
|||
|
||||
UniValue entry(UniValue::VOBJ);
|
||||
|
||||
entry.pushKV("data", EncodeHexTx(tx));
|
||||
entry.pushKV("data", EncodeHexTx(tx, fSupportsSegwit ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS));
|
||||
entry.pushKV("txid", txHash.GetHex());
|
||||
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue