From 58d94f6cddcfc2a13eea134f2fb6a9eb88e80b90 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 23 Nov 2018 09:01:21 -1100 Subject: [PATCH] Prevent sprout after deadline --- src/wallet/rpcwallet.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index d3154a8aa..7e820871b 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3540,6 +3540,8 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp) } if (addrType == ADDR_TYPE_SPROUT) { + if ( GetTime() >= KOMODO_SAPLING_DEADLINE ) + throw JSONRPCError(RPC_INVALID_PARAMETER, "sprout not valid anymore"); return EncodePaymentAddress(pwalletMain->GenerateNewSproutZKey()); } else if (addrType == ADDR_TYPE_SAPLING) { return EncodePaymentAddress(pwalletMain->GenerateNewSaplingZKey()); @@ -4101,7 +4103,11 @@ UniValue z_sendmany(const UniValue& params, bool fHelp) RPC_INVALID_PARAMETER, "Cannot send to both Sprout and Sapling addresses using z_sendmany"); } - + if ( GetTime() > KOMODO_SAPLING_DEADLINE ) + { + if ( fromSprout || toSprout ) + throw JSONRPCError(RPC_INVALID_PARAMETER,"Sprout usage has expired"); + } // If we are sending from a shielded address, all recipient // shielded addresses must be of the same type. if (fromSprout && toSapling) {