Deletions and cleanups
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
#define EVAL_MARMARA 0xef
|
||||
|
||||
extern uint8_t ASSETCHAINS_MARMARA;
|
||||
uint64_t komodo_block_prg(uint32_t nHeight);
|
||||
uint64_t hush_block_prg(uint32_t nHeight);
|
||||
int32_t MarmaraGetcreatetxid(uint256 &createtxid,uint256 txid);
|
||||
int32_t MarmaraGetbatontxid(std::vector<uint256> &creditloop,uint256 &batontxid,uint256 txid);
|
||||
UniValue MarmaraCreditloop(uint256 txid);
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
#define CC_INCLUDE_H
|
||||
|
||||
/*! \file CCinclude.h
|
||||
\brief A Documented file.
|
||||
\brief Cryptoconditions
|
||||
|
||||
CCs for teh lulz
|
||||
|
||||
Details.
|
||||
*/
|
||||
|
||||
/// \mainpage Brief introduction into cryptocondition contracts
|
||||
@@ -240,8 +241,6 @@ extern CWallet* pwalletMain; //!< global wallet object pointer to access wallet
|
||||
|
||||
/// @private seems old-style
|
||||
bool GetAddressUnspent(uint160 addressHash, int type,std::vector<std::pair<CAddressUnspentKey,CAddressUnspentValue> > &unspentOutputs);
|
||||
//CBlockIndex *komodo_getblockindex(uint256 hash); //moved to komodo_def.h
|
||||
//int32_t hush_nextheight(); //moved to komodo_def.h
|
||||
|
||||
/// CCgetspenttxid finds the txid of the transaction which spends a transaction output. The function does this without loading transactions from the chain, by using spent index
|
||||
/// @param[out] spenttxid transaction id of the spending transaction
|
||||
@@ -257,11 +256,6 @@ void CCclearvars(struct CCcontract_info *cp);
|
||||
UniValue CClib(struct CCcontract_info *cp,char *method,char *jsonstr);
|
||||
UniValue CClib_info(struct CCcontract_info *cp);
|
||||
|
||||
//CBlockIndex *hush_blockindex(uint256 hash); //moved to komodo_def.h
|
||||
//CBlockIndex *hush_chainactive(int32_t height); //moved to komodo_def.h
|
||||
//int32_t hush_blockheight(uint256 hash); //moved to komodo_def.h
|
||||
//void StartShutdown();
|
||||
|
||||
static const uint256 zeroid; //!< null uint256 constant
|
||||
|
||||
/// \cond INTERNAL
|
||||
@@ -380,11 +374,8 @@ int64_t IsTokensvout(bool goDeeper, bool checkPubkeys, struct CCcontract_info *c
|
||||
/// returns true if success
|
||||
bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx);
|
||||
|
||||
//void komodo_sendmessage(int32_t minpeers,int32_t maxpeers,const char *message,std::vector<uint8_t> payload); // moved to hush_defs.h
|
||||
|
||||
/// @private
|
||||
int32_t payments_parsehexdata(std::vector<uint8_t> &hexdata,cJSON *item,int32_t len);
|
||||
// int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex); // this def in hush_defs.h
|
||||
|
||||
/// Makes opreturn scriptPubKey for token creation transaction. Normally this function is called internally by the tokencreate rpc. You might need to call this function to create a customized token.
|
||||
/// The total opreturn length should not exceed 10001 byte
|
||||
@@ -701,7 +692,6 @@ uint64_t stringbits(char *str);
|
||||
uint256 revuint256(uint256 txid);
|
||||
char *uint256_str(char *dest,uint256 txid);
|
||||
char *pubkey33_str(char *dest,uint8_t *pubkey33);
|
||||
//uint256 Parseuint256(const char *hexstr); // located in komodo_defs
|
||||
/// \endcond
|
||||
|
||||
/// converts public key as array of uint8_t to normal address
|
||||
@@ -795,8 +785,6 @@ int32_t CCCointxidExists(char const *logcategory,uint256 cointxid);
|
||||
/// @private
|
||||
uint256 BitcoinGetProofMerkleRoot(const std::vector<uint8_t> &proofData, std::vector<uint256> &txids);
|
||||
|
||||
// bool komodo_txnotarizedconfirmed(uint256 txid); //moved to hush_defs.h
|
||||
|
||||
/// @private
|
||||
CPubKey check_signing_pubkey(CScript scriptSig);
|
||||
|
||||
|
||||
@@ -529,7 +529,7 @@ int64_t CCduration(int32_t &numblocks,uint256 txid)
|
||||
//fprintf(stderr,"CCduration no hashBlock for txid %s\n",uint256_str(str,txid));
|
||||
return(0);
|
||||
}
|
||||
else if ( (pindex= komodo_getblockindex(hashBlock)) == 0 || (txtime= pindex->nTime) == 0 || (txheight= pindex->GetHeight()) <= 0 )
|
||||
else if ( (pindex= hush_getblockindex(hashBlock)) == 0 || (txtime= pindex->nTime) == 0 || (txheight= pindex->GetHeight()) <= 0 )
|
||||
{
|
||||
fprintf(stderr,"CCduration no txtime %u or txheight.%d %p for txid %s\n",txtime,txheight,pindex,uint256_str(str,txid));
|
||||
return(0);
|
||||
@@ -666,7 +666,7 @@ uint256 BitcoinGetProofMerkleRoot(const std::vector<uint8_t> &proofData, std::ve
|
||||
}
|
||||
|
||||
extern struct NSPV_inforesp NSPV_inforesult;
|
||||
int32_t komodo_get_current_height()
|
||||
int32_t hush_get_current_height()
|
||||
{
|
||||
if ( HUSH_NSPV_SUPERLITE )
|
||||
{
|
||||
|
||||
@@ -939,7 +939,7 @@ bool DiceValidate(struct CCcontract_info *cp,Eval *eval,const CTransaction &tx,
|
||||
if ( (iswin= DiceIsWinner(entropy,entropyvout,txid,tx,vinTx,hash,sbits,minbet,maxbet,maxodds,timeoutblocks,fundingtxid)) != 0 )
|
||||
{
|
||||
// will only happen for fundingPubKey
|
||||
if ( HUSH_INSYNC != 0 && KOMODO_DEALERNODE != 0 )
|
||||
if ( HUSH_INSYNC != 0 && HUSH_DEALERNODE != 0 )
|
||||
DiceQueue(iswin,sbits,fundingtxid,txid,tx,entropyvout);
|
||||
}
|
||||
else
|
||||
@@ -1791,8 +1791,8 @@ double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettx
|
||||
{
|
||||
if ( myGetTransaction(betTx.vin[0].prevout.hash,entropyTx,hashBlock) != 0 )
|
||||
{
|
||||
flag = KOMODO_DEALERNODE != 0;
|
||||
if ( KOMODO_DEALERNODE != 0 && scriptPubKey == fundingPubKey )
|
||||
flag = HUSH_DEALERNODE != 0;
|
||||
if ( HUSH_DEALERNODE != 0 && scriptPubKey == fundingPubKey )
|
||||
{
|
||||
bettorentropy = DiceGetEntropy(betTx,'B');
|
||||
if ( (iswin= DiceIsWinner(hentropyproof,entropyvout,txid,betTx,entropyTx,bettorentropy,sbits,minbet,maxbet,maxodds,timeoutblocks,fundingtxid)) != 0 )
|
||||
@@ -1821,7 +1821,7 @@ double DiceStatus(uint64_t txfee,char *planstr,uint256 fundingtxid,uint256 bettx
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( didinit == 0 && KOMODO_DEALERNODE == 0 && scriptPubKey == fundingPubKey )
|
||||
if ( didinit == 0 && HUSH_DEALERNODE == 0 && scriptPubKey == fundingPubKey )
|
||||
{
|
||||
strcpy(_planstr,planstr);
|
||||
dealer0_fundingtxid = fundingtxid;
|
||||
|
||||
@@ -71,7 +71,7 @@ int64_t prices_blockinfo(int32_t height,char *acaddr)
|
||||
std::vector<uint8_t> vopret; CBlockIndex *pindex; CBlock block; CTransaction tx,vintx; uint64_t pricebits; char destaddr[64]; uint32_t aveprice=0,timestamp,uprice; uint256 hashBlock; int64_t dist,mindist=(1LL<<60),prizefund = 0; int32_t mini=-1,i,n,vini,numvouts,iter; struct prices_bar refbar;
|
||||
if ( (pindex= hush_chainactive(height)) != 0 )
|
||||
{
|
||||
if ( komodo_blockload(block,pindex) == 0 )
|
||||
if ( hush_blockload(block,pindex) == 0 )
|
||||
{
|
||||
n = block.vtx.size();
|
||||
vini = 0;
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
vout.n-1: opreturn with oracletxid, prevbatontxid and data in proper format
|
||||
|
||||
*/
|
||||
extern int32_t komodo_get_current_height();
|
||||
extern int32_t hush_get_current_height();
|
||||
#define PUBKEY_SPOOFING_FIX_ACTIVATION 1563148800
|
||||
#define CC_MARKER_VALUE 10000
|
||||
|
||||
@@ -946,7 +946,7 @@ UniValue OracleRegister(const CPubKey& pk, int64_t txfee,uint256 oracletxid,int6
|
||||
CCERR_RESULT("oraclescc",CCLOG_INFO, stream << "error adding inputs from your Oracles CC address, please fund it first with oraclesfund rpc!");
|
||||
mtx.vout.push_back(CTxOut(txfee,CScript() << ParseHex(HexStr(markerpubkey)) << OP_CHECKSIG));
|
||||
mtx.vout.push_back(MakeCC1vout(cp->evalcode,txfee,batonpk));
|
||||
if (GetLatestTimestamp(komodo_get_current_height())>PUBKEY_SPOOFING_FIX_ACTIVATION) mtx.vout.push_back(CTxOut(txfee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
||||
if (GetLatestTimestamp(hush_get_current_height())>PUBKEY_SPOOFING_FIX_ACTIVATION) mtx.vout.push_back(CTxOut(txfee,CScript() << ParseHex(HexStr(mypk)) << OP_CHECKSIG));
|
||||
return(FinalizeCCTxExt(pk.IsValid(),0,cp,mtx,mypk,txfee,EncodeOraclesOpRet('R',oracletxid,mypk,datafee)));
|
||||
}
|
||||
CCERR_RESULT("oraclescc",CCLOG_INFO, stream << "error adding normal inputs");
|
||||
|
||||
2186
src/cc/prices.cpp
2186
src/cc/prices.cpp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user