diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 0e687c3d4..12e7cc4c2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1560,14 +1560,15 @@ CScript komodo_mineropret(int32_t nHeight) int32_t komodo_opretvalidate(int32_t nHeight,CScript scriptPubKey) { - std::vector vopret; uint32_t pricebits[4]; int32_t i; + std::vector vopret; uint32_t pricebits[4]; int32_t i,lag; if ( ASSETCHAINS_CBOPRET != 0 ) { GetOpReturnData(scriptPubKey,vopret); if ( vopret.size() == sizeof(pricebits) ) { memcpy(pricebits,&Mineropret[0],sizeof(pricebits)); - fprintf(stderr,"ht.%d: t%u %.4f USD, %.4f GBP, %.4f EUR\n",nHeight,pricebits[0],(double)pricebits[1]/10000,(double)pricebits[2]/10000,(double)pricebits[3]/10000); + lag = (int32_t)(time(NULL) - pricebits[0]); + fprintf(stderr,"ht.%d: t%u lag.%d %.4f USD, %.4f GBP, %.4f EUR\n",nHeight,pricebits[0],lag,(double)pricebits[1]/10000,(double)pricebits[2]/10000,(double)pricebits[3]/10000); return(0); } return(-1); diff --git a/src/main.cpp b/src/main.cpp index d6993d203..b73a31856 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1018,9 +1018,9 @@ bool ContextualCheckCoinbaseTransaction(const CTransaction& tx, const int nHeigh { } - else if ( ASSETCHAINS_CBOPRET != 0 ) + else if ( ASSETCHAINS_CBOPRET != 0 && nHeight > 0 && tx.vout.size() > 0 ) { - if ( komodo_opretvalidate(nHeight,tx.vout[1].scriptPubKey) < 0 ) + if ( komodo_opretvalidate(nHeight,tx.vout[tx.vout.size()-1].scriptPubKey) < 0 ) return(false); } return(true);