diff --git a/qa/rpc-tests/dpow.py b/qa/rpc-tests/dpow.py index fda3f6b9c..5339d23f9 100755 --- a/qa/rpc-tests/dpow.py +++ b/qa/rpc-tests/dpow.py @@ -28,6 +28,7 @@ class DPoWTest(BitcoinTestFramework): result = rpc.getinfo() print result # TODO: actually do notarizations on regtest and test for specific data + # regtest should have no notarization data, this test makes sure we do not see mainnet values as well! assert_equal(result['notarized'],0) assert_equal(result['notarizedhash'],'0000000000000000000000000000000000000000000000000000000000000000') diff --git a/src/komodo_validation011.h b/src/komodo_validation011.h index 1de8dd6ff..4e10251e5 100644 --- a/src/komodo_validation011.h +++ b/src/komodo_validation011.h @@ -109,20 +109,18 @@ int32_t gettxout_scriptPubKey(int32_t height,uint8_t *scriptPubKey,int32_t maxsi } } - if ( n >= 0 && n < (int32_t)tx.vout.size() ) + if ( !tx.IsNull() && n >= 0 && n < (int32_t)tx.vout.size() ) { ptr = (uint8_t *)tx.vout[n].scriptPubKey.data(); m = tx.vout[n].scriptPubKey.size(); for (i=0; i voutsize.%d\n",height,n,(int32_t)tx.vout.size()); return(-1); @@ -777,7 +775,7 @@ int32_t komodo_init() decode_hex(NOTARY_PUBKEY33,33,(char *)NOTARY_PUBKEY.c_str()); if ( GetBoolArg("-txindex", DEFAULT_TXINDEX) == 0 ) { - fprintf(stderr,"txindex is off, import notary pubkeys\n"); + //fprintf(stderr,"txindex is off, import notary pubkeys\n"); KOMODO_NEEDPUBKEYS = 1; KOMODO_TXINDEX = 0; } @@ -1099,7 +1097,8 @@ int32_t komodo_checkpoint(int32_t *notarized_heightp,int32_t nHeight,uint256 has if ( notarized_height >= 0 && notarized_height <= pindex->nHeight && mapBlockIndex.count(notarized_hash) != 0 ) { notary = mapBlockIndex[notarized_hash]; - printf("nHeight.%d -> (%d %s)\n",pindex->nHeight,notarized_height,notarized_hash.ToString().c_str()); + if ( IS_NOTARY ) + printf("nHeight.%d -> (%d %s)\n",pindex->nHeight,notarized_height,notarized_hash.ToString().c_str()); if ( notary->nHeight == notarized_height ) // if notarized_hash not in chain, reorg { if ( nHeight < notarized_height )