Browse Source

Test

pull/4/head
jl777 6 years ago
parent
commit
fa4d9e24af
  1. 7
      src/komodo_bitcoind.h
  2. 2
      src/komodo_gateway.h

7
src/komodo_bitcoind.h

@ -557,11 +557,10 @@ uint64_t komodo_seed(int32_t height)
return(seed);
}
uint32_t komodo_txtime(uint64_t *valuep,uint256 hash,int32_t n,char *address)
uint32_t komodo_txtime(uint64_t *valuep,uint256 hash,int32_t n,char *destaddr)
{
CTxDestination address; CTransaction tx; uint256 hashBlock;
*valuep = 0;
address[0] = 0;
if (!GetTransaction(hash, tx,
#ifndef KOMODO_ZCASH
Params().GetConsensus(),
@ -575,8 +574,8 @@ uint32_t komodo_txtime(uint64_t *valuep,uint256 hash,int32_t n,char *address)
if ( n < tx.vout.size() )
{
*valuep = tx.vout[n].nValue;
if (ExtractDestination(tx.scriptPubKey, address))
strcpy(address,CBitcoinAddress(address).ToString().c_str());
if (ExtractDestination(tx.vout[n].scriptPubKey, address))
strcpy(destaddr,CBitcoinAddress(address).ToString().c_str());
}
return(tx.nLockTime);
}

2
src/komodo_gateway.h

@ -682,7 +682,7 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_
minage = 6000;
if ( blocktime > txtime+minage && (pindex= komodo_chainactive(nHeight>200?nHeight-200:1)) != 0 )
{
vcalc_sha256(0,(uint8_t *)&addrhash,address,(int32_t)strlen(address));
vcalc_sha256(0,(uint8_t *)&addrhash,(uint8_t *)address,(int32_t)strlen(address));
pasthash = pindex->GetBlockHash();
memcpy(hashbuf,&pasthash,sizeof(pasthash));
memcpy(&hashbuf[sizeof(pasthash)],&addrhash,sizeof(addrhash));

Loading…
Cancel
Save