From 6420c2d1c0ac052d40416ee8f73cf12e05785525 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Jul 2018 05:56:50 -1100 Subject: [PATCH 1/5] Test --- src/komodo_bitcoind.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 6aadde9b8..0ca0bd123 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1248,8 +1248,6 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ { CBlockIndex *previndex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,txn_count,eligible,isPoS = 0; uint64_t value; CTxDestination voutaddress; txn_count = pblock->vtx.size(); - if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) - return(1); if ( txn_count > 1 && pblock->vtx[txn_count-1].vin.size() == 1 && pblock->vtx[txn_count-1].vout.size() == 1 ) { if ( prevtime == 0 ) @@ -1277,8 +1275,10 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ isPoS = 1; // close enough for a pre-filter else fprintf(stderr,"komodo_is_PoSblock ht.%d (%s) != (%s) or %.8f != %.8f\n",height,destaddr,voutaddr,dstr(value),dstr(pblock->vtx[txn_count-1].vout[0].nValue)); } else fprintf(stderr,"komodo_is_PoSblock ht.%d couldnt extract voutaddress\n",height); - } else return(-1); + } //else return(-1); } + if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) + return(1); return(isPoS); } From d4acce54ac3df12a22c21e6f5229f0b9a7b99d6b Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Jul 2018 06:03:22 -1100 Subject: [PATCH 2/5] Test --- src/komodo_bitcoind.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 0ca0bd123..2374c3262 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1277,6 +1277,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ } else fprintf(stderr,"komodo_is_PoSblock ht.%d couldnt extract voutaddress\n",height); } //else return(-1); } + fprintf(stderr,"slow.%d ht.%d isPoS.%d\n",slowflag,height,isPoS); if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) return(1); return(isPoS); From 5c6adb31e91cac5f12be0b5beecc86d73ef136b2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Jul 2018 06:06:07 -1100 Subject: [PATCH 3/5] Test --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 2374c3262..df0cc6baa 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1275,7 +1275,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ isPoS = 1; // close enough for a pre-filter else fprintf(stderr,"komodo_is_PoSblock ht.%d (%s) != (%s) or %.8f != %.8f\n",height,destaddr,voutaddr,dstr(value),dstr(pblock->vtx[txn_count-1].vout[0].nValue)); } else fprintf(stderr,"komodo_is_PoSblock ht.%d couldnt extract voutaddress\n",height); - } //else return(-1); + } else return(-1); } fprintf(stderr,"slow.%d ht.%d isPoS.%d\n",slowflag,height,isPoS); if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) From 764576d5e2ffeb4a84d9416606745475da35f483 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Jul 2018 06:11:06 -1100 Subject: [PATCH 4/5] Prepare for new isPoS --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index df0cc6baa..2374c3262 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1275,7 +1275,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ isPoS = 1; // close enough for a pre-filter else fprintf(stderr,"komodo_is_PoSblock ht.%d (%s) != (%s) or %.8f != %.8f\n",height,destaddr,voutaddr,dstr(value),dstr(pblock->vtx[txn_count-1].vout[0].nValue)); } else fprintf(stderr,"komodo_is_PoSblock ht.%d couldnt extract voutaddress\n",height); - } else return(-1); + } //else return(-1); } fprintf(stderr,"slow.%d ht.%d isPoS.%d\n",slowflag,height,isPoS); if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) From ffd6dd51965634aa9a02e74a79b87106a8737105 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Jul 2018 06:19:48 -1100 Subject: [PATCH 5/5] Fix isPoS detection --- src/komodo_bitcoind.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 2374c3262..d459678f9 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1247,6 +1247,8 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_uint256 bnTarget) { CBlockIndex *previndex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,txn_count,eligible,isPoS = 0; uint64_t value; CTxDestination voutaddress; + if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) + return(1); txn_count = pblock->vtx.size(); if ( txn_count > 1 && pblock->vtx[txn_count-1].vin.size() == 1 && pblock->vtx[txn_count-1].vout.size() == 1 ) { @@ -1277,9 +1279,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ } else fprintf(stderr,"komodo_is_PoSblock ht.%d couldnt extract voutaddress\n",height); } //else return(-1); } - fprintf(stderr,"slow.%d ht.%d isPoS.%d\n",slowflag,height,isPoS); - if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) - return(1); + //fprintf(stderr,"slow.%d ht.%d isPoS.%d\n",slowflag,height,isPoS); return(isPoS); }