From 58bec1f9b51b98cc7a49a9780eca0719f67b0930 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 24 Mar 2017 01:27:03 +0200 Subject: [PATCH] Test --- src/komodo_bitcoind.h | 2 +- src/main.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 9c615c329..bfd138287 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -605,7 +605,7 @@ CBlockIndex *komodo_chainactive(int32_t height) uint32_t komodo_heightstamp(int32_t height) { CBlock block; CBlockIndex *ptr; - if ( (ptr= komodo_chainactive(height)) != 0 ) + if ( height > 0 && (ptr= komodo_chainactive(height)) != 0 ) { if ( komodo_blockload(block,ptr) == 0 && komodo_block2height(&block) == height ) return(block.nTime); diff --git a/src/main.cpp b/src/main.cpp index 4c37892bd..de593507f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -761,6 +761,8 @@ int32_t komodo_validate_interest(uint32_t *expiredp,const CTransaction& tx,int32 } else fprintf(stderr,"validateinterest grandfather.%d locktime %u vs txheighttime.%u tiptime.%u txb.%u cmp.%u\n",(int32_t)txheight,tx.nLockTime,txheighttime,tiptime,txblocktime,cmptime); } }*/ + if ( txheightarg == 0 ) + txheightarg = chainActive.Tip()->nHeight + 1; if ( (cmptime= komodo_heightstamp(txheightarg-1)) == 0 ) { cmptime = chainActive.Tip()->nTime;