Browse Source

Merge branch 'dev' into jl777

pull/4/head
jl777 6 years ago
committed by GitHub
parent
commit
7213e636c1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/komodo.h
  2. 46
      src/miner.cpp
  3. 3
      src/pow.cpp

6
src/komodo.h

@ -679,7 +679,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
}
else
{
komodo_rwccdata(ASSETCHAINS_SYMBOL,1,&ccdata,&MoMoMdata);
//komodo_rwccdata(ASSETCHAINS_SYMBOL,1,&ccdata,&MoMoMdata);
//printf("[%s] matched.%d VALID (%s) MoM.%s [%d]\n",ASSETCHAINS_SYMBOL,matched,ccdata.symbol,MoM.ToString().c_str(),MoMdepth);
}
if ( MoMoMdata.pairs != 0 )
@ -687,8 +687,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
memset(&ccdata,0,sizeof(ccdata));
memset(&MoMoMdata,0,sizeof(MoMoMdata));
}
else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
komodo_rwccdata((char *)"KMD",1,&ccdata,0);
//else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
// komodo_rwccdata((char *)"KMD",1,&ccdata,0);
if ( matched != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height )
{
sp->NOTARIZED_HEIGHT = *notarizedheightp;

46
src/miner.cpp

@ -508,47 +508,47 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
}
/*
#ifdef ENABLE_WALLET
boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey)
#else
boost::optional<CScript> GetMinerScriptPubKey()
#endif
{
#ifdef ENABLE_WALLET
boost::optional<CScript> GetMinerScriptPubKey(CReserveKey& reservekey)
#else
boost::optional<CScript> GetMinerScriptPubKey()
#endif
{
CKeyID keyID;
CBitcoinAddress addr;
if (addr.SetString(GetArg("-mineraddress", ""))) {
addr.GetKeyID(keyID);
} else {
#ifdef ENABLE_WALLET
#ifdef ENABLE_WALLET
CPubKey pubkey;
if (!reservekey.GetReservedKey(pubkey)) {
return boost::optional<CScript>();
}
keyID = pubkey.GetID();
#else
#else
return boost::optional<CScript>();
#endif
#endif
}
CScript scriptPubKey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
return scriptPubKey;
}
}
#ifdef ENABLE_WALLET
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
{
#ifdef ENABLE_WALLET
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
{
boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey(reservekey);
#else
CBlockTemplate* CreateNewBlockWithKey()
{
#else
CBlockTemplate* CreateNewBlockWithKey()
{
boost::optional<CScript> scriptPubKey = GetMinerScriptPubKey();
#endif
#endif
if (!scriptPubKey) {
return NULL;
}
return CreateNewBlock(*scriptPubKey);
}*/
}*/
//////////////////////////////////////////////////////////////////////////////
//
@ -1109,14 +1109,14 @@ void static BitcoinMiner()
}
miningTimer.stop();
c.disconnect();
}
}
#ifdef ENABLE_WALLET
void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads)
void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads)
#else
void GenerateBitcoins(bool fGenerate, int nThreads)
void GenerateBitcoins(bool fGenerate, int nThreads)
#endif
{
{
static boost::thread_group* minerThreads = NULL;
if (nThreads < 0)
@ -1140,6 +1140,6 @@ void GenerateBitcoins(bool fGenerate, int nThreads)
minerThreads->create_thread(&BitcoinMiner);
#endif
}
}
}
#endif // ENABLE_MINING

3
src/pow.cpp

@ -192,7 +192,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int
return true;
if ( ASSETCHAINS_SYMBOL[0] != 0 || height > 792000 )
{
if ( 1 && height > 792000 )
if ( 0 && height > 792000 )
{
for (i=31; i>=0; i--)
printf("%02x",((uint8_t *)&hash)[i]);
@ -222,6 +222,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int
return true;
}
arith_uint256 GetBlockProof(const CBlockIndex& block)
{
arith_uint256 bnTarget;

Loading…
Cancel
Save