From 77bbe2471eb01928456c69f4b309c53331b0f406 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:12:50 +0200 Subject: [PATCH 1/6] test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 8a1e0380f..1c319db81 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -905,7 +905,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) + if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& tiptime > KOMODO_GRANDFATHER_TIME ) { 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 68d59d5bad4b596f3e279ed0b925500060de9393 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:16:33 +0200 Subject: [PATCH 2/6] Revert "test" This reverts commit 77bbe2471eb01928456c69f4b309c53331b0f406. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1c319db81..8a1e0380f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -905,7 +905,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& tiptime > KOMODO_GRANDFATHER_TIME ) + if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { 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 3ffe93d8155abeab266b85982dc62443fd402946 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:46:29 +0200 Subject: [PATCH 3/6] Test --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8a1e0380f..ff27a1d71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,7 +706,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -int32_t komodo_grandfathered(uint32_t locktime) +/*int32_t komodo_grandfathered(uint32_t locktime) { static uint32_t grandfathered[] = { @@ -736,6 +736,7 @@ int32_t komodo_grandfathered(uint32_t locktime) } #define KOMODO_GRANDFATHER_TIME (1490155211 + 3600) //(1490114274 + 3600*24) +*/ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int flags) { @@ -744,7 +745,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 ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) + if ( nBlockTime > 1490159171 ) // 246748 + //if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) { 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 @@ -905,7 +907,8 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) + if ( nBlockTime > 1490159171 ) // 246748 + //if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { 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 f656b6a5b00cd513448c8c4cb1ae52baff5e7c11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:47:36 +0200 Subject: [PATCH 4/6] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ff27a1d71..7af975b4d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -907,7 +907,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) tiptime = chainActive.Tip()->nTime; if ( (int64_t)tx.nLockTime < tiptime-3600 ) { - if ( nBlockTime > 1490159171 ) // 246748 + if ( tiptime > 1490159171 ) // 246748 //if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { 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); From 5c60cb4546faf2a7a32c2a48f9ee5bae01e75602 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:50:05 +0200 Subject: [PATCH 5/6] Hardcode 1490159171 --- src/main.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7af975b4d..0c2d97694 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -706,38 +706,6 @@ bool IsStandardTx(const CTransaction& tx, string& reason) return true; } -/*int32_t komodo_grandfathered(uint32_t locktime) -{ - static uint32_t grandfathered[] = - { - //1477262681, 1477262990, 1477598030, 1477269321, 1480625490, 1482008580, 1485678643, 1485972116, 1486039258, 1486096477, 1486159886, 1486236495, 1486305013, 1486390414, 1486390791, 1486391232, 1486395617, 1486415304, 1486439074, 1486507244, 1486536946, 1486766037, 1486766559, 1486768230, 1486768294, 1487355181, 1487356312, 1487449891, 1487467926, 1487614001, 1487639158, 1489298992, 1489299229, 1489299737, 1489299939, 1489300155, 1489300326, 1489300370, 1489408020, 1489408285, 1489438206, 1489463334, 1489519879, 1489519942, 1489519818, 1489597387, 1489663030, 1489687820, 1489796259, 1489838437, 1489847404, 1490022684, 1490117937, 1490118373 - 1477258935, 1477257204, 1477253947, 1477254016, 1477251241, 1477251105, 1477250875, 1477249280, - 1477249145, 1477249036, 1477248998, 1477248821, 1477248760, 1477248662, 1477248623, 1477248467, - 1477248430, 1477248389, 1477248268, 1477247602, 1477247563, 1477247480, 1477247443, 1477247152, - 1477246967, 1477246843, 1477246772, 1477246737, 1477246659, 1477246372, 1477246214, 1477245870, - 1477245519, 1477245434, 1477245280, 1477245043, 1477244956, 1477244721, 1477244574, 1477244444, - 1477244345, 1477244293, 1477253223, 1477253297, 1477252992, 1477253025, 1477256283, 1476963619, - 1480538961, 1480538961, 1481994241, 1485376185, 1485964187, 1486019481, 1486126273, 1486232034, - 1486231980, 1486158028, 1486381700, 1486367151, 1486369396, 1486369400, 1486369739, 1486381492, - 1486502320, 1486496032, 1486507806, 1486490938, 1485981956, 1486466190, 1487578969, 1487625710, - 1488740061, 1489381998, 1489368980, 1489394298, 1489379223, 1489373356, 1489381621, 1489385381, - 1489383213, 1489419739, 1489381922, 1489511155, 1489372632, 1489519630, 1489683097, 1489695388, - 1489817053, 1489814059, 1489958883, 1490111575, 1490111662, 1490111716, 1490111757, 1490112310, - 1490112397, 1490114274, 1490116047, - }; - int32_t i; - if ( locktime <= grandfathered[sizeof(grandfathered)/sizeof(*grandfathered) - 1] ) - { - for (i=0; i= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { if ( nBlockTime > 1490159171 ) // 246748 - //if ( komodo_grandfathered(tx.nLockTime) < 0 )//&& nBlockTime > KOMODO_GRANDFATHER_TIME ) { 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 @@ -908,7 +875,6 @@ int32_t komodo_validate_interest(const CTransaction& tx) if ( (int64_t)tx.nLockTime < tiptime-3600 ) { if ( tiptime > 1490159171 ) // 246748 - //if ( komodo_grandfathered(tx.nLockTime) < 0 && tiptime > KOMODO_GRANDFATHER_TIME ) { 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 d8268972fb320c2af2e3bc71d394c4e2b03b77e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 22 Mar 2017 07:52:42 +0200 Subject: [PATCH 6/6] Test --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 0c2d97694..a22488533 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -876,7 +876,9 @@ int32_t komodo_validate_interest(const CTransaction& tx) { if ( tiptime > 1490159171 ) // 246748 { - 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); + 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); return(-1); } }