From ce12d37c54404da7d9e6ccd0e6e0d4ef30b76d05 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 23 Nov 2018 07:33:28 -1100 Subject: [PATCH] Reverse sapling polarity --- src/komodo_bitcoind.h | 2 +- src/wallet/rpcwallet.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 6ca62261c..943c8c413 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1865,7 +1865,7 @@ int64_t komodo_newcoins(int64_t *zfundsp,int32_t nHeight,CBlock *pblock) zfunds -= joinsplit.vpub_new; zfunds += joinsplit.vpub_old; } - zfunds += tx.valueBalance; + zfunds -= tx.valueBalance; } *zfundsp = zfunds; if ( ASSETCHAINS_SYMBOL[0] == 0 && (voutsum-vinsum) == 100003*SATOSHIDEN ) // 15 times diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 2e0320095..8568c930a 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3509,7 +3509,10 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp) bool allowSapling = (Params().GetConsensus().vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight <= chainActive.LastTip()->GetHeight()); - std::string defaultType = ADDR_TYPE_SPROUT; + std::string defaultType; + if ( time() < KOMODO_SAPLING_ACTIVATION ) + defaultType = ADDR_TYPE_SPROUT; + else defaultType = ADDR_TYPE_SAPLING; if (fHelp || params.size() > 1) throw runtime_error(