Browse Source

Notarizations in regtest. Every 7th block is notarized in regtest

next
Jonathan "Duke" Leto 6 years ago
parent
commit
2f14564c79
  1. 6
      qa/rpc-tests/dpowconfs.py
  2. 9
      src/komodo_validation011.h

6
qa/rpc-tests/dpowconfs.py

@ -22,7 +22,11 @@ class DPoWConfsTest(BitcoinTestFramework):
self.sync_all()
def run_test(self):
self.nodes[0].generate(101)
rpc = self.nodes[0]
rpc.generate(8)
print rpc.getinfo()
self.nodes[0].generate(94)
print rpc.getinfo()
rpc = self.nodes[0]
result = rpc.listunspent()

9
src/komodo_validation011.h

@ -1172,6 +1172,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
{
static int32_t hwmheight;
uint64_t signedmask; uint8_t scriptbuf[4096],pubkeys[64][33],scriptPubKey[35]; uint256 zero; int32_t i,j,k,m,numnotaries,notarized,scriptlen,numvalid,specialtx,notarizedheight,len,numvouts,numvins,height,txn_count;
uint256 txhash;
if ( KOMODO_NEEDPUBKEYS != 0 )
{
@ -1197,7 +1198,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
//fprintf(stderr, "txn_count=%d\n", txn_count);
for (i=0; i<txn_count; i++)
{
//txhash = block.vtx[i]->GetHash();
txhash = block.vtx[i].GetHash();
numvouts = block.vtx[i].vout.size();
specialtx = notarizedheight = notarized = 0;
signedmask = 0;
@ -1224,8 +1225,12 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
numvalid = bitweight(signedmask);
if ( numvalid >= KOMODO_MINRATIFY )
notarized = 1;
if ( Params().NetworkIDString() == "regtest" && ( height%7 == 0) )
if ( Params().NetworkIDString() == "regtest" && ( height%7 == 0) ) {
notarized = 1;
NOTARIZED_HEIGHT = height;
//NOTARIZED_HASH = hash;
NOTARIZED_DESTTXID = txhash;
}
if ( IS_NOTARY )
LogPrint("dpow","(tx.%d: ",i);
for (j=0; j<numvouts; j++)

Loading…
Cancel
Save