diff --git a/src/hush_bitcoind.h b/src/hush_bitcoind.h index ce90b6347..bf53316db 100644 --- a/src/hush_bitcoind.h +++ b/src/hush_bitcoind.h @@ -676,7 +676,7 @@ int32_t hush_is_notarytx(const CTransaction& tx) decode_hex(crypto555,33,(char *)CRYPTO555_PUBSECPSTR); if ( memcmp(ptr+1,crypto555,33) == 0 ) { - //printf("found notarytx\n"); + fprintf(stderr,"%s: found notarytx\n", __func__); return(1); } } diff --git a/src/hush_notary.h b/src/hush_notary.h index 0d10ed6c5..a9280a923 100644 --- a/src/hush_notary.h +++ b/src/hush_notary.h @@ -99,6 +99,11 @@ int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp) int32_t hush_season = 0; bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; hush_season = ishush3 ? gethushseason(height) : getacseason(timestamp); + + if(IS_HUSH_NOTARY) { + fprintf(stderr,"%s: [%s] season=%d height=%d time=%d\n", __func__, ishush3 ? "HUSH3" : SMART_CHAIN_SYMBOL, hush_season, height, timestamp); + } + if ( hush_season != 0 ) { if ( didinit[hush_season-1] == 0 ) diff --git a/src/main.cpp b/src/main.cpp index 785dd5ee2..0771ffdb5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1452,8 +1452,12 @@ bool CheckTransaction(uint32_t tiptime,const CTransaction& tx, CValidationState return true; } +// This is used only in RPC currently but hush_notaries()/gethushseason/getacseason is consensus int32_t hush_isnotaryvout(char *coinaddr,uint32_t tiptime) { - int32_t season = getacseason(tiptime); + bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false; + int32_t height = chainActive.LastTip()->GetHeight(); + int32_t season = ishush3 ? gethushseason(height) : getacseason(tiptime); + fprintf(stderr,"%s: season=%d, tiptime=%d\n", __func__, season,tiptime); if ( NOTARY_ADDRESSES[season-1][0][0] == 0 ) { uint8_t pubkeys[64][33]; hush_notaries(pubkeys,0,tiptime);