From 94549326c9c1ce5c2eeca969a02e434479520a1d Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 11 Sep 2018 12:45:25 +0100 Subject: [PATCH] Bugfix: Use time instead of block height for Sapling key metadata --- src/wallet/rpcdump.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 0ddad82e1..50d2ce78c 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -593,9 +593,12 @@ public: } // Sapling addresses can't have been used in transactions prior to activation. - m_wallet->mapSaplingZKeyMetadata[ivk].nCreateTime = std::max( - 1, // In case a code fork sets Sapling to always be active - params.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight); + if (params.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight == Consensus::NetworkUpgrade::ALWAYS_ACTIVE) { + m_wallet->mapSaplingZKeyMetadata[ivk].nCreateTime = 1; + } else { + // Friday, 26 October 2018 00:00:00 GMT - definitely before Sapling activates + m_wallet->mapSaplingZKeyMetadata[ivk].nCreateTime = 1540512000; + } return false; }