Hush is the extreme future, Komodo is the KYC past

This commit is contained in:
Duke Leto
2020-12-16 22:49:58 -05:00
parent 676931bc84
commit e3a68dfdfb
33 changed files with 106 additions and 186 deletions

View File

@@ -46,7 +46,7 @@
#include <string>
#include <thread>
int32_t komodo_blockheight(uint256 hash);
int32_t hush_blockheight(uint256 hash);
using namespace libzcash;

View File

@@ -51,7 +51,7 @@ using namespace libzcash;
extern char SMART_CHAIN_SYMBOL[65];
int32_t hush_dpowconfs(int32_t height,int32_t numconfs);
int32_t komodo_blockheight(uint256 hash);
int32_t hush_blockheight(uint256 hash);
int tx_height( const uint256 &hash );
bool hush_hardfork_active(uint32_t time);
extern UniValue signrawtransaction(const UniValue& params, bool fHelp, const CPubKey& mypk);

View File

@@ -138,10 +138,10 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
entry.push_back(Pair("generated", true));
if (confirms > 0)
{
entry.push_back(Pair("confirmations", hush_dpowconfs((int32_t)komodo_blockheight(wtx.hashBlock),confirms)));
entry.push_back(Pair("confirmations", hush_dpowconfs((int32_t)hush_blockheight(wtx.hashBlock),confirms)));
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
entry.push_back(Pair("blockindex", wtx.nIndex));
entry.push_back(Pair("blocktime", (uint64_t)komodo_blocktime(wtx.hashBlock)));
entry.push_back(Pair("blocktime", (uint64_t)hush_blocktime(wtx.hashBlock)));
entry.push_back(Pair("expiryheight", (int64_t)wtx.nExpiryHeight));
} else entry.push_back(Pair("confirmations", confirms));
uint256 hash = wtx.GetHash();
@@ -1659,7 +1659,7 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts)
tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nConf = min(item.nConf, nDepth);
item.nHeight = komodo_blockheight(wtx.hashBlock);
item.nHeight = hush_blockheight(wtx.hashBlock);
item.txids.push_back(wtx.GetHash());
if (mine & ISMINE_WATCH_ONLY)
item.fIsWatchonly = true;
@@ -5561,8 +5561,8 @@ int32_t ensure_CCrequirements(uint8_t evalcode) {
if ( ASSETCHAINS_CCDISABLES[evalcode] != 0 || (evalcode == EVAL_MARMARA && ASSETCHAINS_MARMARA == 0) )
{
// check if a height activation has been set.
fprintf(stderr, "evalcode.%i activates at height. %i current height.%i\n", evalcode, mapHeightEvalActivate[evalcode], komodo_currentheight());
if ( mapHeightEvalActivate[evalcode] == 0 || komodo_currentheight() == 0 || mapHeightEvalActivate[evalcode] > komodo_currentheight() )
fprintf(stderr, "evalcode.%i activates at height. %i current height.%i\n", evalcode, mapHeightEvalActivate[evalcode], hush_currentheight());
if ( mapHeightEvalActivate[evalcode] == 0 || hush_currentheight() == 0 || mapHeightEvalActivate[evalcode] > hush_currentheight() )
{
fprintf(stderr,"evalcode %d disabled\n",evalcode);
return(-1);

View File

@@ -64,7 +64,7 @@ bool fSendFreeTransactions = false;
bool fPayAtLeastCustomFee = true;
#include "hush_defs.h"
CBlockIndex *komodo_chainactive(int32_t height);
CBlockIndex *hush_chainactive(int32_t height);
extern std::string DONATION_PUBKEY;
int32_t hush_dpowconfs(int32_t height,int32_t numconfs);
int tx_height( const uint256 &hash );

View File

@@ -38,7 +38,7 @@ using namespace std;
static uint64_t nAccountingEntryNumber = 0;
static list<uint256> deadTxns;
extern CBlockIndex *komodo_blockindex(uint256 hash);
extern CBlockIndex *hush_blockindex(uint256 hash);
//
// CWalletDB
@@ -932,7 +932,7 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
if (!EraseTx(hash))
fprintf(stderr, "could not delete tx.%s\n",hash.ToString().c_str());
uint256 blockhash; CTransaction tx; CBlockIndex* pindex;
if ( GetTransaction(hash,tx,blockhash,false) && (pindex= komodo_blockindex(blockhash)) != 0 && chainActive.Contains(pindex) )
if ( GetTransaction(hash,tx,blockhash,false) && (pindex= hush_blockindex(blockhash)) != 0 && chainActive.Contains(pindex) )
{
CWalletTx wtx(pwallet,tx);
pwallet->AddToWallet(wtx, true, NULL);