Test
This commit is contained in:
@@ -658,6 +658,13 @@ int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t komodo_chainactive_timestamp()
|
||||||
|
{
|
||||||
|
if ( chainActive.Tip() != 0 )
|
||||||
|
return((uint32_t)chainActive.Tip()->GetBlockTime());
|
||||||
|
else return(0);
|
||||||
|
}
|
||||||
|
|
||||||
CBlockIndex *komodo_chainactive(int32_t height)
|
CBlockIndex *komodo_chainactive(int32_t height)
|
||||||
{
|
{
|
||||||
if ( chainActive.Tip() != 0 )
|
if ( chainActive.Tip() != 0 )
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
#include "streams.h"
|
#include "streams.h"
|
||||||
#include "uint256.h"
|
#include "uint256.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "consensus/validation.h"
|
|
||||||
|
|
||||||
#include "sodium.h"
|
#include "sodium.h"
|
||||||
|
|
||||||
#ifdef ENABLE_RUST
|
#ifdef ENABLE_RUST
|
||||||
#include "librustzcash.h"
|
#include "librustzcash.h"
|
||||||
#endif // ENABLE_RUST
|
#endif // ENABLE_RUST
|
||||||
|
uint32_t komodo_chainactive_timestamp();
|
||||||
|
|
||||||
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
|
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
|
||||||
{
|
{
|
||||||
@@ -136,8 +136,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
|||||||
extern int32_t KOMODO_REWIND;
|
extern int32_t KOMODO_REWIND;
|
||||||
bool fNegative,fOverflow; int32_t i,nonzpkeys=0,nonz=0,special=0,special2=0,notaryid=-1,duplicate,flag = 0, mids[66]; uint32_t timestamp = 0;
|
bool fNegative,fOverflow; int32_t i,nonzpkeys=0,nonz=0,special=0,special2=0,notaryid=-1,duplicate,flag = 0, mids[66]; uint32_t timestamp = 0;
|
||||||
arith_uint256 bnTarget; CBlockIndex *pindex; uint8_t pubkeys[66][33];
|
arith_uint256 bnTarget; CBlockIndex *pindex; uint8_t pubkeys[66][33];
|
||||||
if ( (pindex= chainActive.Tip()) != 0 )
|
timestamp = komodo_chainactive_timestamp();
|
||||||
timestamp = (uint32_t)pindex->GetBlockTime();
|
|
||||||
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
|
||||||
if ( height == 0 )
|
if ( height == 0 )
|
||||||
height = komodo_currentheight() + 1;
|
height = komodo_currentheight() + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user