Browse Source

test

pull/4/head
jl777 8 years ago
parent
commit
6b0e06b5d0
  1. 8
      src/komodo_bitcoind.h
  2. 2
      src/komodo_gateway.h
  3. 12
      src/rpcblockchain.cpp

8
src/komodo_bitcoind.h

@ -372,6 +372,8 @@ uint256 komodo_getblockhash(int32_t height)
return(hash);
}
uint256 _komodo_getblockhash(int32_t height);
uint64_t komodo_seed(int32_t height)
{
uint256 hash; uint64_t seed = 0; CBlockIndex *pindex;
@ -379,10 +381,8 @@ uint64_t komodo_seed(int32_t height)
if ( height > 10 )
height -= 10;
if ( ASSETCHAINS_SYMBOL[0] == 0 )
{
if ( (pindex= chainActive[height]) != 0 )
hash = pindex->GetBlockHash();
} else hash = komodo_getblockhash(height);
hash = _komodo_getblockhash(height);
else hash = komodo_getblockhash(height);
seed = arith_uint256(hash.GetHex()).GetLow64();
return(seed);
}

2
src/komodo_gateway.h

@ -589,7 +589,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
if ( didstats != 0 )
pax->didstats = 1;
}
}
} else printf("pax %s deposit %.8f rejected\n",base,dstr(fiatoshis));
}
}
}

12
src/rpcblockchain.cpp

@ -272,6 +272,18 @@ Value getblockhash(const Array& params, bool fHelp)
return pblockindex->GetBlockHash().GetHex();
}
uint256 _komodo_getblockhash(int32_t height);
{
uint256 hash;
LOCK(cs_main);
if ( nHeight >= 0 && nHeight <= chainActive.Height() )
{
CBlockIndex* pblockindex = chainActive[nHeight];
hash = pblockindex->GetBlockHash();
} else memset(&hash,0,sizeof(hash));
return(hash);
}
Value getblock(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)

Loading…
Cancel
Save