From 082d65d2069c0fa91683c6294ed2094191145f45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:21:40 +0200 Subject: [PATCH 01/10] Test --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a22488533..efa369ea0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,8 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockHeight > 246748 ) + //if ( nBlockTime > 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,11 +875,12 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + //if ( tiptime > 1490159171 ) // 246748 + if ( txheight > 246748 ) { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 8886b0acc7fd29ebe3949e3a392e699f839729a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:29:42 +0200 Subject: [PATCH 02/10] Revert "Test" This reverts commit 082d65d2069c0fa91683c6294ed2094191145f45. --- src/main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index efa369ea0..a22488533 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,8 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockHeight > 246748 ) - //if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockTime > 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -875,12 +874,11 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - //if ( tiptime > 1490159171 ) // 246748 - if ( txheight > 246748 ) + if ( tiptime > 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 228d46dee6e74bc4d7dd0643f248385fbdc27e57 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:47:57 +0200 Subject: [PATCH 03/10] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a22488533..a8c654d54 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + if ( tiptime >= 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From bab020f8beb27a3e36a0ffc41b63a4871cc3ea1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 09:58:57 +0200 Subject: [PATCH 04/10] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index a8c654d54..fe9f7f510 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime >= 1490159171 ) // 246748 + if ( tiptime > 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 8b05d7f20ddafcf6c048adee546e17985511ca97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:07:51 +0200 Subject: [PATCH 05/10] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index fe9f7f510..a8c654d54 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + if ( tiptime >= 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 64a80d765821b1ba1ada42465f426ce015387b87 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:36:33 +0200 Subject: [PATCH 06/10] Test --- src/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a8c654d54..373d44f22 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,8 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime >= 1490159171 ) // 246748 + //if ( nBlockTime >= 1490159171 ) // 246748 + if ( nBlockHeight > 246748 ) { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +875,8 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime >= 1490159171 ) // 246748 + //if ( tiptime > 1490159171 ) // 246748 + if ( txheight > 246748 ) { static uint32_t counter; if ( counter++ < 100 ) From 57010b98ffed01082e8f7610fb8a682e41df8e78 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:40:23 +0200 Subject: [PATCH 07/10] Test --- src/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 373d44f22..fe9f7f510 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,8 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - //if ( nBlockTime >= 1490159171 ) // 246748 - if ( nBlockHeight > 246748 ) + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -875,8 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - //if ( tiptime > 1490159171 ) // 246748 - if ( txheight > 246748 ) + if ( tiptime > 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From d1370f18fad64e77247c2cf40e2454c707f89709 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:52:51 +0200 Subject: [PATCH 08/10] Test --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fe9f7f510..0656d5295 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -715,9 +715,9 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int { if ( nBlockTime >= 1490159171 ) // 246748 { - fprintf(stderr,"[%d] IsFinalTx reject locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),tx.nLockTime,(uint32_t)nBlockTime); + fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx - } else fprintf(stderr,"IsFinalTx grandfather locktime %u vs nBlockTime %u\n",tx.nLockTime,(uint32_t)nBlockTime); + } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; @@ -878,7 +878,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) { static uint32_t counter; if ( counter++ < 100 ) - fprintf(stderr,"komodo_validate_interest reject locktime %u/%u vs nBlockTime %u tiptime.%u\n",(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); + fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u tiptime.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,tiptime); return(-1); } } From 6b19769fda67feaa56b06df62e5a5707fc3c03d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 10:58:11 +0200 Subject: [PATCH 09/10] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0656d5295..b0831d155 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime >= 1490159171 ) // 246748 + if ( nBlockTime > 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime > 1490159171 ) // 246748 + if ( tiptime >= 1490159171 ) // 246748 { static uint32_t counter; if ( counter++ < 100 ) From 3bc8ab81e6c816f78fea68ade9b758582ca958aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 11:08:49 +0200 Subject: [PATCH 10/10] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b0831d155..a62103f7c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -713,7 +713,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int return true; if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( nBlockTime >= 1490159171 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx @@ -874,7 +874,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( tiptime >= 1490159171 ) // 246748 + if ( tiptime > 1490159171 || (txheight == 0 && tiptime >= 1490159171) ) // 246748 { static uint32_t counter; if ( counter++ < 100 )