diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index bd79eaa68..c2ae14d7f 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -26,7 +26,7 @@ #else #define MIN_NON_NOTARIZED_CONFIRMS 101 #endif // TESTMODE -int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); +int32_t hush_dpowconfs(int32_t height,int32_t numconfs); struct komodo_state *komodo_stateptr(char *symbol,char *dest); extern uint32_t KOMODO_DPOWCONFS; diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 0c9113885..b7221846d 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -477,7 +477,7 @@ int32_t komodo_kvsearch(uint256 *refpubkeyp,int32_t current_height,uint32_t *fla uint32_t komodo_blocktime(uint256 hash); int32_t komodo_longestchain(); -int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); +int32_t hush_dpowconfs(int32_t height,int32_t numconfs); int8_t komodo_segid(int32_t nocache,int32_t height); int32_t komodo_heightpricebits(uint64_t *seedp,uint32_t *heightbits,int32_t nHeight); char *komodo_pricename(char *name,int32_t ind); diff --git a/src/komodo_notary.h b/src/komodo_notary.h index ef81b972d..cda89c967 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -342,7 +342,7 @@ int32_t komodo_notarized_height(int32_t *prevMoMheightp,uint256 *hashp,uint256 * } else return(0); } -int32_t komodo_dpowconfs(int32_t txheight,int32_t numconfs) +int32_t hush_dpowconfs(int32_t txheight,int32_t numconfs) { static int32_t hadnotarization; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; struct komodo_state *sp; diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index e82fde943..87f945d98 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -145,7 +145,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex) // Only report confirmations if the block is on the main chain if (chainActive.Contains(blockindex)) confirmations = chainActive.Height() - blockindex->GetHeight() + 1; - result.push_back(Pair("confirmations", komodo_dpowconfs(blockindex->GetHeight(),confirmations))); + result.push_back(Pair("confirmations", hush_dpowconfs(blockindex->GetHeight(),confirmations))); result.push_back(Pair("rawconfirmations", confirmations)); result.push_back(Pair("height", blockindex->GetHeight())); result.push_back(Pair("version", blockindex->nVersion)); @@ -178,7 +178,7 @@ UniValue blockToDeltasJSON(const CBlock& block, const CBlockIndex* blockindex) } else { throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block is an orphan"); } - result.push_back(Pair("confirmations", komodo_dpowconfs(blockindex->GetHeight(),confirmations))); + result.push_back(Pair("confirmations", hush_dpowconfs(blockindex->GetHeight(),confirmations))); result.push_back(Pair("rawconfirmations", confirmations)); result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))); result.push_back(Pair("height", blockindex->GetHeight())); @@ -299,7 +299,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx // Only report confirmations if the block is on the main chain if (chainActive.Contains(blockindex)) confirmations = chainActive.Height() - blockindex->GetHeight() + 1; - result.push_back(Pair("confirmations", komodo_dpowconfs(blockindex->GetHeight(),confirmations))); + result.push_back(Pair("confirmations", hush_dpowconfs(blockindex->GetHeight(),confirmations))); result.push_back(Pair("rawconfirmations", confirmations)); result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))); result.push_back(Pair("height", blockindex->GetHeight())); @@ -1489,7 +1489,7 @@ UniValue gettxout(const UniValue& params, bool fHelp, const CPubKey& mypk) ret.push_back(Pair("confirmations", 0)); ret.push_back(Pair("rawconfirmations", 0)); } else { - ret.push_back(Pair("confirmations", komodo_dpowconfs(coins.nHeight,pindex->GetHeight() - coins.nHeight + 1))); + ret.push_back(Pair("confirmations", hush_dpowconfs(coins.nHeight,pindex->GetHeight() - coins.nHeight + 1))); ret.push_back(Pair("rawconfirmations", pindex->GetHeight() - coins.nHeight + 1)); } ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue))); diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index ddd464775..8526f21f1 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -57,7 +57,7 @@ int32_t komodo_notarized_height(int32_t *prevMoMheightp,uint256 *hashp,uint256 * using namespace std; extern char ASSETCHAINS_SYMBOL[]; -int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); +int32_t hush_dpowconfs(int32_t height,int32_t numconfs); void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex) { @@ -266,7 +266,7 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue& if (nConfirmations > 0) { entry.push_back(Pair("height", nHeight)); - entry.push_back(Pair("confirmations", komodo_dpowconfs(nHeight,nConfirmations))); + entry.push_back(Pair("confirmations", hush_dpowconfs(nHeight,nConfirmations))); entry.push_back(Pair("rawconfirmations", nConfirmations)); entry.push_back(Pair("time", nBlockTime)); entry.push_back(Pair("blocktime", nBlockTime)); @@ -350,7 +350,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) if (chainActive.Contains(pindex)) { entry.push_back(Pair("height", pindex->GetHeight())); entry.push_back(Pair("rawconfirmations", 1 + chainActive.Height() - pindex->GetHeight())); - entry.push_back(Pair("confirmations", komodo_dpowconfs(pindex->GetHeight(),1 + chainActive.Height() - pindex->GetHeight()))); + entry.push_back(Pair("confirmations", hush_dpowconfs(pindex->GetHeight(),1 + chainActive.Height() - pindex->GetHeight()))); entry.push_back(Pair("time", pindex->GetBlockTime())); entry.push_back(Pair("blocktime", pindex->GetBlockTime())); } else { diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index 7ccbd1467..0d48f2cf2 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -55,7 +55,7 @@ using namespace libzcash; extern char ASSETCHAINS_SYMBOL[65]; -int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); +int32_t hush_dpowconfs(int32_t height,int32_t numconfs); int32_t komodo_blockheight(uint256 hash); int tx_height( const uint256 &hash ); bool hush_hardfork_active(uint32_t time); @@ -621,7 +621,7 @@ bool AsyncRPCOperation_sendmany::find_utxos(bool fAcceptCoinbase=false) { if( mindepth_ > 1 ) { int nHeight = tx_height(out.tx->GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, out.nDepth); + int dpowconfs = hush_dpowconfs(nHeight, out.nDepth); if (dpowconfs < mindepth_) { continue; } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fdd5400cb..63285f5ee 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -75,7 +75,7 @@ const std::string ADDR_TYPE_SAPLING = "sapling"; const std::string ADDR_TYPE_AMNESIA = "amnesia"; extern int32_t HUSH_INSYNC; uint32_t komodo_segid32(char *coinaddr); -int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); +int32_t hush_dpowconfs(int32_t height,int32_t numconfs); int32_t komodo_isnotaryvout(char *coinaddr,uint32_t tiptime); // from ac_private chains only CBlockIndex *komodo_getblockindex(uint256 hash); extern string randomSietchZaddr(); @@ -152,7 +152,7 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry) entry.push_back(Pair("generated", true)); if (confirms > 0) { - entry.push_back(Pair("confirmations", komodo_dpowconfs((int32_t)komodo_blockheight(wtx.hashBlock),confirms))); + entry.push_back(Pair("confirmations", hush_dpowconfs((int32_t)komodo_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))); @@ -986,7 +986,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp, const CPubKey& int nDepth = wtx.GetDepthInMainChain(); if( nMinDepth > 1 ) { int nHeight = tx_height(wtx.GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, nDepth); + int dpowconfs = hush_dpowconfs(nHeight, nDepth); if (dpowconfs >= nMinDepth) { nAmount += txout.nValue; // komodo_interest? } @@ -1076,7 +1076,7 @@ CAmount GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi int nDepth = wtx.GetDepthInMainChain(); if( nMinDepth > 1 ) { int nHeight = tx_height(wtx.GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, nDepth); + int dpowconfs = hush_dpowconfs(nHeight, nDepth); if (nReceived != 0 && dpowconfs >= nMinDepth) { nBalance += nReceived; } @@ -1260,7 +1260,7 @@ UniValue getbalance(const UniValue& params, bool fHelp, const CPubKey& mypk) int nDepth = wtx.GetDepthInMainChain(); if( nMinDepth > 1 ) { int nHeight = tx_height(wtx.GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, nDepth); + int dpowconfs = hush_dpowconfs(nHeight, nDepth); if (dpowconfs >= nMinDepth) { BOOST_FOREACH(const COutputEntry& r, listReceived) nBalance += r.amount; @@ -1653,7 +1653,7 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts) int nDepth = wtx.GetDepthInMainChain(); if( nMinDepth > 1 ) { int nHeight = tx_height(wtx.GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, nDepth); + int dpowconfs = hush_dpowconfs(nHeight, nDepth); if (dpowconfs < nMinDepth) continue; } else { @@ -1720,7 +1720,7 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts) obj.push_back(Pair("account", strAccount)); obj.push_back(Pair("amount", ValueFromAmount(nAmount))); obj.push_back(Pair("rawconfirmations", (nConf == std::numeric_limits::max() ? 0 : nConf))); - obj.push_back(Pair("confirmations", (nConf == std::numeric_limits::max() ? 0 : komodo_dpowconfs(nHeight, nConf)))); + obj.push_back(Pair("confirmations", (nConf == std::numeric_limits::max() ? 0 : hush_dpowconfs(nHeight, nConf)))); UniValue transactions(UniValue::VARR); if (it != mapTally.end()) { @@ -1747,7 +1747,7 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts) obj.push_back(Pair("account", (*it).first)); obj.push_back(Pair("amount", ValueFromAmount(nAmount))); obj.push_back(Pair("rawconfirmations", (nConf == std::numeric_limits::max() ? 0 : nConf))); - obj.push_back(Pair("confirmations", (nConf == std::numeric_limits::max() ? 0 : komodo_dpowconfs(nHeight, nConf)))); + obj.push_back(Pair("confirmations", (nConf == std::numeric_limits::max() ? 0 : hush_dpowconfs(nHeight, nConf)))); ret.push_back(obj); } } @@ -2938,7 +2938,7 @@ UniValue listunspent(const UniValue& params, bool fHelp, const CPubKey& mypk) int nDepth = out.tx->GetDepthInMainChain(); if( nMinDepth > 1 ) { int nHeight = tx_height(out.tx->GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, nDepth); + int dpowconfs = hush_dpowconfs(nHeight, nDepth); if (dpowconfs < nMinDepth || dpowconfs > nMaxDepth) continue; } else { @@ -2992,7 +2992,7 @@ UniValue listunspent(const UniValue& params, bool fHelp, const CPubKey& mypk) txheight = (chainActive.LastTip()->GetHeight() - out.nDepth - 1); entry.push_back(Pair("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); entry.push_back(Pair("rawconfirmations",out.nDepth)); - entry.push_back(Pair("confirmations",komodo_dpowconfs(txheight,out.nDepth))); + entry.push_back(Pair("confirmations",hush_dpowconfs(txheight,out.nDepth))); entry.push_back(Pair("spendable", out.fSpendable)); results.push_back(entry); } @@ -3801,7 +3801,7 @@ UniValue z_listunspent(const UniValue& params, bool fHelp, const CPubKey& mypk) UniValue obj(UniValue::VOBJ); int nHeight = tx_height(entry.op.hash); - int dpowconfs = komodo_dpowconfs(nHeight, entry.confirmations); + int dpowconfs = hush_dpowconfs(nHeight, entry.confirmations); // Only return notarized results when minconf>1 if (nMinDepth > 1 && dpowconfs == 1) @@ -4025,7 +4025,7 @@ CAmount getBalanceTaddr(std::string transparentAddress, int minDepth=1, bool ign int nDepth = out.tx->GetDepthInMainChain(); if( minDepth > 1 ) { int nHeight = tx_height(out.tx->GetHash()); - int dpowconfs = komodo_dpowconfs(nHeight, nDepth); + int dpowconfs = hush_dpowconfs(nHeight, nDepth); if (dpowconfs < minDepth) { continue; } @@ -4132,7 +4132,7 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp, const CPubK for (SaplingNoteEntry & entry : saplingEntries) { UniValue obj(UniValue::VOBJ); int nHeight = tx_height(entry.op.hash); - int dpowconfs = komodo_dpowconfs(nHeight, entry.confirmations); + int dpowconfs = hush_dpowconfs(nHeight, entry.confirmations); // Only return notarized results when minconf>1 if (nMinDepth > 1 && dpowconfs == 1) continue; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d833117cb..9f7b55ef2 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -70,7 +70,7 @@ bool fPayAtLeastCustomFee = true; CBlockIndex *komodo_chainactive(int32_t height); extern std::string DONATION_PUBKEY; -int32_t komodo_dpowconfs(int32_t height,int32_t numconfs); +int32_t hush_dpowconfs(int32_t height,int32_t numconfs); int tx_height( const uint256 &hash ); bool fTxDeleteEnabled = false; bool fTxConflictDeleteEnabled = false; @@ -4867,7 +4867,7 @@ void CWallet::GetFilteredNotes( continue; } int nDepth = wtx.GetDepthInMainChain(); - int dpowconfs = komodo_dpowconfs(nHeight,nDepth); + int dpowconfs = hush_dpowconfs(nHeight,nDepth); if ( dpowconfs < minDepth || dpowconfs > maxDepth) { continue; }