diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 72136427c..2174a8d80 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -411,7 +411,7 @@ int32_t komodo_verifynotarizedscript(int32_t height,uint8_t *script,int32_t len, for (i=0; i<32; i++) ((uint8_t *)&hash)[i] = script[2+i]; if ( hash == NOTARIZED_HASH ) - return(0); + return(1); for (i=0; i<32; i++) printf("%02x",((uint8_t *)&NOTARIZED_HASH)[i]); printf(" notarized, "); diff --git a/src/komodo_events.h b/src/komodo_events.h index 54e2b7f8c..324e97436 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -39,17 +39,17 @@ struct komodo_event *komodo_eventadd(struct komodo_state *sp,int32_t height,char void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t height,char *dest,uint256 notarized_hash,uint256 notarized_desttxid,int32_t notarizedheight,uint256 MoM,int32_t MoMdepth) { - static uint32_t counter; char *coin; struct komodo_event_notarized N; + static uint32_t counter; int32_t verified=0; char *coin; struct komodo_event_notarized N; coin = (ASSETCHAINS_SYMBOL[0] == 0) ? (char *)"KMD" : ASSETCHAINS_SYMBOL; - if ( counter < 10 && NOTARY_PUBKEY33[0] != 0 && strcmp(symbol,coin) == 0 && komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid) != 0 ) + if ( counter < 100 && NOTARY_PUBKEY33[0] != 0 && (verified= komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid)) < 0 ) { - if ( height > 50000 || ASSETCHAINS_SYMBOL[0] != 0 ) + //if ( height > 50000 || ASSETCHAINS_SYMBOL[0] != 0 ) printf("[%s] error validating notarization ht.%d notarized_height.%d, if on a pruned %s node this can be ignored\n",ASSETCHAINS_SYMBOL,height,notarizedheight,dest); counter++; } - else + else if ( strcmp(symbol,coin) == 0 ) { - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + if ( verified != 0 ) fprintf(stderr,"validated [%s] ht.%d notarized %d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); memset(&N,0,sizeof(N)); N.blockhash = notarized_hash;