speed up miner modifications?

This commit is contained in:
blackjok3r
2018-11-28 20:52:50 +08:00
parent 7399a87134
commit 7a25c614cf

View File

@@ -105,6 +105,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams,
}
#include "komodo_defs.h"
#define CRYPTO777_KMDADDR "RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA"
extern int32_t KOMODO_MININGTHREADS,KOMODO_LONGESTCHAIN,ASSETCHAINS_SEED,IS_KOMODO_NOTARY,ASSETCHAINS_STREAM,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAIN_INIT,KOMODO_INITDONE,KOMODO_ON_DEMAND,KOMODO_INITDONE,KOMODO_PASSPORT_INITDONE;
extern uint64_t ASSETCHAINS_REWARD,ASSETCHAINS_COMMISSION,ASSETCHAINS_STAKED;
@@ -214,7 +215,12 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
nTotalIn += nValueIn;
dPriority += (double)nValueIn * 1000; // flat multiplier
} else {
int numNotaryVins = 0;
// TODO: It will be much faster here to just compare scriptpubkey!
CTxDestination ToAddress; int numNotaryVins = 0; bool fToCryptoAddress = false;
if (ExtractDestination(tx.vout[0].scriptPubKey, ToAddress)) {
if ( strcmp(CRYPTO777_KMDADDR,CBitcoinAddress(ToAddress).ToString().c_str()) == 0 )
fToCryptoAddress = true;
}
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
// Read prev transaction
@@ -253,7 +259,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
int nConf = nHeight - coins->nHeight;
if ( NOTARYADDRS[0][0] != 0 && NUM_NOTARIES != 0 )
if ( NOTARYADDRS[0][0] != 0 && NUM_NOTARIES != 0 && fToCryptoAddress )
{
uint256 hash; CTransaction tx1; CTxDestination address;
if (GetTransaction(txin.prevout.hash,tx1,hash,false))