Remove dead code

This commit is contained in:
Duke
2024-11-09 09:18:08 -05:00
parent d8a799abe3
commit d31c69cf23
2 changed files with 1 additions and 97 deletions

View File

@@ -49,35 +49,9 @@
#define CCDISABLEALL memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES))
#define CCENABLE(x) ASSETCHAINS_CCDISABLES[((uint8_t)x)] = 0
/* moved to hush_cJSON.h
#ifndef _BITS256
#define _BITS256
union _bits256 { uint8_t bytes[32]; uint16_t ushorts[16]; uint32_t uints[8]; uint64_t ulongs[4]; uint64_t txid; };
typedef union _bits256 bits256;
#endif
*/
/// \endcond
/// identifiers of additional data blobs in token opreturn script:
/// @see EncodeTokenCreateOpRet(uint8_t funcid, std::vector<uint8_t> origpubkey, std::string name, std::string description, std::vector<std::pair<uint8_t, vscript_t>> oprets)
/// @see GetOpretBlob
enum opretid : uint8_t {
// cc contracts data:
OPRETID_NONFUNGIBLEDATA = 0x11, //!< NFT data id
OPRETID_ASSETSDATA = 0x12, //!< assets contract data id
OPRETID_GATEWAYSDATA = 0x13, //!< gateways contract data id
OPRETID_CHANNELSDATA = 0x14, //!< channels contract data id
OPRETID_HEIRDATA = 0x15, //!< heir contract data id
OPRETID_ROGUEGAMEDATA = 0x16, //!< rogue contract data id
OPRETID_PEGSDATA = 0x17, //!< pegs contract data id
/*! \cond INTERNAL */
// non cc contract data:
OPRETID_FIRSTNONCCDATA = 0x80,
/*! \endcond */
OPRETID_BURNDATA = 0x80, //!< burned token data id
OPRETID_IMPORTDATA = 0x81 //!< imported token data id
};
/// finds opret blob data by opretid in the vector of oprets
/// @param oprets vector of oprets
@@ -100,16 +74,6 @@ struct CC_utxo
};
/// \endcond
/// \cond INTERNAL
struct CC_meta
{
std::vector<unsigned char> version;
uint8_t evalCode;
bool is1of2;
uint8_t numDestinations;
// followed by address destinations
};
/// \endcond
/// CC contract (Antara module) info structure that contains data used for signing and validation of cc contract transactions
struct CCcontract_info

View File

@@ -294,69 +294,9 @@ int32_t NSPV_mempoolfuncs(bits256 *satoshisp,int32_t *vindexp,std::vector<uint25
int32_t num = 0,vini = 0,vouti = 0; uint8_t evalcode=0,func=0; std::vector<uint8_t> vopret; char destaddr[64];
*vindexp = -1;
memset(satoshisp,0,sizeof(*satoshisp));
/*
if ( funcid == NSPV_CC_TXIDS)
{
std::vector<std::pair<CAddressIndexKey, CAmount> > tmp_txids; uint256 tmp_txid,hashBlock;
int32_t n=0,skipcount=vout>>16; uint8_t eval=(vout>>8)&0xFF, func=vout&0xFF;
CTransaction tx;
SetCCtxids(tmp_txids,coinaddr,isCC);
if ( skipcount < 0 ) skipcount = 0;
if ( skipcount >= tmp_txids.size() )
skipcount = tmp_txids.size()-1;
if ( tmp_txids.size()-skipcount > 0 )
{
for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=tmp_txids.begin(); it!=tmp_txids.end(); it++)
{
if (txid!=zeroid || func!=0)
{
myGetTransaction(it->first.txhash,tx,hashBlock);
std::vector<std::pair<uint8_t, vscript_t>> oprets; uint256 tokenid,txid;
std::vector<uint8_t> vopret,vOpretExtra; uint8_t *script,e,f,tokenevalcode;
std::vector<CPubKey> pubkeys;
if (DecodeTokenOpRet(tx.vout[tx.vout.size()-1].scriptPubKey,tokenevalcode,tokenid,pubkeys,oprets)!=0 && GetOpretBlob(oprets, OPRETID_CHANNELSDATA, vOpretExtra) && tokenevalcode==EVAL_TOKENS && vOpretExtra.size()>0)
{
vopret=vOpretExtra;
}
else GetOpReturnData(tx.vout[tx.vout.size()-1].scriptPubKey, vopret);
script = (uint8_t *)vopret.data();
if ( vopret.size() > 2 && script[0]==eval )
{
switch (eval)
{
case EVAL_CHANNELS:EVAL_PEGS:EVAL_ORACLES:EVAL_GAMES:EVAL_IMPORTGATEWAY:EVAL_ROGUE:
E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> tmp_txid;);
if (e!=eval || (txid!=zeroid && txid!=tmp_txid) || (func!=0 && f!=func)) continue;
break;
case EVAL_TOKENS:EVAL_DICE:EVAL_DILITHIUM:EVAL_FAUCET:EVAL_LOTO:EVAL_PAYMENTS:EVAL_REWARDS:
E_UNMARSHAL(vopret,ss >> e; ss >> f;);
if (e!=eval || (func!=0 && f!=func)) continue;
break;
default:
break;
}
}
}
if ( n >= skipcount ) txids.push_back(it->first.txhash);
n++;
}
return (n-skipcount);
}
return (0);
}
*/
if ( mempool.size() == 0 )
return(0);
/*
if ( funcid == NSPV_MEMPOOL_CCEVALCODE )
{
isCC = true;
evalcode = vout & 0xff;
func = (vout >> 8) & 0xff;
}
*/
LOCK(mempool.cs);
BOOST_FOREACH(const CTxMemPoolEntry &e,mempool.mapTx)
{