From ec27eae224b0ae4c5cf119d5ef29262de878bd45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 20:18:31 +0300 Subject: [PATCH 1/8] Test --- iguana/iguana_notary.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index e29b0a4d7..6b613fa42 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -262,7 +262,7 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) } } } - else if ( strcmp(dp->symbol,"KMD") == 0 ) + else //if ( strcmp(dp->symbol,"KMD") == 0 ) { while ( dp->lastheight <= height ) { @@ -270,13 +270,13 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) dpow_srcupdate(myinfo,dp,dp->lastheight++,blockhash,(uint32_t)time(NULL),blocktime); } } - else if ( time(NULL) > dp->lastsrcupdate+60 || height != dp->lastheight ) + /*else if ( time(NULL) > dp->lastsrcupdate+60 || height != dp->lastheight ) { dp->lastsrcupdate = (uint32_t)time(NULL); dp->lastheight = height; blockhash = dpow_getblockhash(myinfo,src,dp->lastheight); dpow_srcupdate(myinfo,dp,dp->lastheight,blockhash,(uint32_t)time(NULL),blocktime); - } + }*/ } //else printf("error getchaintip for %s\n",dp->symbol); } else printf("iguana_dPoWupdate missing src.(%s) %p or dest.(%s) %p\n",dp->symbol,src,dp->dest,dest); } From 556f2346c0bb427b5aaee6cbbbc6124a671209f2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 20:32:34 +0300 Subject: [PATCH 2/8] Test --- iguana/iguana_notary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 6b613fa42..6e4714c3a 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -366,7 +366,7 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) else { dp->minsigs = Notaries_minsigs; //DPOW_MIN_ASSETCHAIN_SIGS; - if ( strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) + if ( freq == 0 && (strcmp("CHIPS",dp->symbol) == 0 || strncmp("TEST",dp->symbol,4) == 0) ) dp->freq = DPOW_MAXFREQ; else if ( freq > 2 ) dp->freq = freq; From e641afcf67af69242cb049a2afab708216f5d224 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 21:16:51 +0300 Subject: [PATCH 3/8] Test --- iguana/dpow/dpow_network.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 7061caa77..5d2c5b208 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1799,6 +1799,8 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct { printf("dont have %s %s utxo, please send funds\n",dp->symbol,srcaddr); } + else if ( strcmp(dp->symbol,"CHIPS") == 0 ) + printf("myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[i].src.prev_hash),bp->notaries[i].src.prev_vout); } } } From 1789387a8a1823136afb0c9784c9db66d1de6881 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 21:18:30 +0300 Subject: [PATCH 4/8] Test --- iguana/dpow/dpow_network.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 5d2c5b208..9661180ee 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1800,7 +1800,10 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct printf("dont have %s %s utxo, please send funds\n",dp->symbol,srcaddr); } else if ( strcmp(dp->symbol,"CHIPS") == 0 ) + { + char str[65]; printf("myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[i].src.prev_hash),bp->notaries[i].src.prev_vout); + } } } } From 09eccdd64404e5dc80654c46a3d641120faa5824 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 21:18:49 +0300 Subject: [PATCH 5/8] Test --- iguana/dpow/dpow_network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 9661180ee..712c8ae88 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1802,7 +1802,7 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct else if ( strcmp(dp->symbol,"CHIPS") == 0 ) { char str[65]; - printf("myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[i].src.prev_hash),bp->notaries[i].src.prev_vout); + printf(">>>>>>> CHIPS myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[i].src.prev_hash),bp->notaries[i].src.prev_vout); } } } From 94dc6e2668a7890fbe3b1b798d75eb2fa91e8836 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 21:41:38 +0300 Subject: [PATCH 6/8] Test --- iguana/dpow/dpow_fsm.c | 5 +++++ iguana/dpow/dpow_network.c | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 12d624137..dd4783c55 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -490,6 +490,11 @@ void dpow_statemachinestart(void *ptr) bp->notaries[myind].ratifydestvout = ep->dest.prev_vout; } } + if ( strcmp(dp->symbol,"CHIPS") == 0 ) + { + char str[65]; + printf(">>>>>>> CHIPS myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[myind].src.prev_hash),bp->notaries[myind].src.prev_vout); + } bp->recvmask |= (1LL << myind); bp->notaries[myind].othermask |= (1LL << myind); dp->checkpoint = checkpoint; diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 712c8ae88..e5ab23fe1 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1799,11 +1799,6 @@ void dpow_ratify_update(struct supernet_info *myinfo,struct dpow_info *dp,struct { printf("dont have %s %s utxo, please send funds\n",dp->symbol,srcaddr); } - else if ( strcmp(dp->symbol,"CHIPS") == 0 ) - { - char str[65]; - printf(">>>>>>> CHIPS myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[i].src.prev_hash),bp->notaries[i].src.prev_vout); - } } } } @@ -1847,6 +1842,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru { bp->notaries[senderind].src.prev_hash = srcutxo; bp->notaries[senderind].src.prev_vout = srcvout; + char str[65]; printf("%s senderind.%d <- %s/v%d\n",dp->symbol,senderind,bits256_str(str,srcutxo),srcvout); } if ( bits256_nonz(destutxo) != 0 ) { From b6b1350b7ddc8ea1fa3d16464ced0416ea8d5092 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 21:52:54 +0300 Subject: [PATCH 7/8] Test --- iguana/dpow/dpow_fsm.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index dd4783c55..bcac23997 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -408,9 +408,9 @@ void dpow_statemachinestart(void *ptr) { myind = i; ep = &bp->notaries[myind]; - for (j=0; j<33; j++) - printf("%02x",dp->minerkey33[j]); - printf(" MYIND.%d <<<<<<<<<<<<<<<<<<<<<<\n",myind); + //for (j=0; j<33; j++) + // printf("%02x",dp->minerkey33[j]); + //printf(" MYIND.%d <<<<<<<<<<<<<<<<<<<<<<\n",myind); } } if ( strcmp("KMD",src->symbol) == 0 ) @@ -426,7 +426,7 @@ void dpow_statemachinestart(void *ptr) exit(-1); return; } - printf("myind.%d\n",myind); + //printf("myind.%d\n",myind); } else { @@ -437,10 +437,6 @@ void dpow_statemachinestart(void *ptr) } bp->myind = myind; printf("[%d] notarize %s->%s %s ht.%d minsigs.%d duration.%d start.%u MoM[%d] %s\n",bp->myind,dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height,minsigs,duration,checkpoint.timestamp,bp->MoMdepth,bits256_str(str2,bp->MoM)); - { - if ( strcmp(dp->symbol,"CHIPS") == 0 && bp->myind == 0 ) - dpow_signedtxgen(myinfo,dp,src,bp,bp->myind,1LL<myind,bp->myind,DPOW_SIGCHANNEL,0,0); - } if ( bp->isratify != 0 && memcmp(bp->notaries[0].pubkey,bp->ratified_pubkeys[0],33) != 0 ) { for (i=0; i<33; i++) @@ -490,10 +486,11 @@ void dpow_statemachinestart(void *ptr) bp->notaries[myind].ratifydestvout = ep->dest.prev_vout; } } - if ( strcmp(dp->symbol,"CHIPS") == 0 ) + if ( strcmp(dp->symbol,"CHIPS") == 0 && myind == 0 ) { char str[65]; - printf(">>>>>>> CHIPS myind.%d %s/v%d\n",i,bits256_str(str,bp->notaries[myind].src.prev_hash),bp->notaries[myind].src.prev_vout); + printf(">>>>>>> CHIPS myind.%d %s/v%d\n",myind,bits256_str(str,bp->notaries[myind].src.prev_hash),bp->notaries[myind].src.prev_vout); + dpow_signedtxgen(myinfo,dp,src,bp,bp->myind,1LL<myind,bp->myind,DPOW_SIGCHANNEL,0,0); } bp->recvmask |= (1LL << myind); bp->notaries[myind].othermask |= (1LL << myind); From 41c16d554d8d6a5c28ef88ae0aa41dcaa7ed2e59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 18 May 2018 22:02:23 +0300 Subject: [PATCH 8/8] Test --- iguana/dpow/dpow_fsm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index bcac23997..454a68117 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -490,6 +490,7 @@ void dpow_statemachinestart(void *ptr) { char str[65]; printf(">>>>>>> CHIPS myind.%d %s/v%d\n",myind,bits256_str(str,bp->notaries[myind].src.prev_hash),bp->notaries[myind].src.prev_vout); + bp->desttxid = bp->notaries[myind].src.prev_hash; dpow_signedtxgen(myinfo,dp,src,bp,bp->myind,1LL<myind,bp->myind,DPOW_SIGCHANNEL,0,0); } bp->recvmask |= (1LL << myind);