From dc889d7f52ca8672ecf45cb56548fc6e3ade36ff Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 3 May 2018 12:02:51 +0100 Subject: [PATCH] Update CreateNewContextualCMutableTransaction to create Sapling transactions --- src/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 27d045135..fff319b66 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6078,8 +6078,13 @@ CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Para bool isOverwintered = NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_OVERWINTER); if (isOverwintered) { mtx.fOverwintered = true; - mtx.nVersionGroupId = OVERWINTER_VERSION_GROUP_ID; - mtx.nVersion = OVERWINTER_TX_VERSION; + if (NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING)) { + mtx.nVersionGroupId = SAPLING_VERSION_GROUP_ID; + mtx.nVersion = SAPLING_TX_VERSION; + } else { + mtx.nVersionGroupId = OVERWINTER_VERSION_GROUP_ID; + mtx.nVersion = OVERWINTER_TX_VERSION; + } // Expiry height is not set. Only fields required for a parser to treat as a valid Overwinter V3 tx. // TODO: In future, when moving from Overwinter to Sapling, it will be useful