From 6bd89d6c44ab34a896f08124a4ae0e82af1e4af9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 May 2018 17:56:42 +0300 Subject: [PATCH 1/2] Test --- iguana/dpow/dpow_network.c | 4 ++-- iguana/m_notary_run | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index 5d9e22d74..4647e24d1 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -16,7 +16,7 @@ extern uint16_t Notaries_port; extern int32_t Notaries_numseeds; extern char *Notaries_seeds[]; -char *Notaries_elected[65][2]; +extern char *Notaries_elected[65][2]; struct signed_nnpacket { @@ -1973,7 +1973,7 @@ void dpow_nanoutxoget(struct supernet_info *myinfo,struct dpow_info *dp,struct d } if ( bp->myind == 0 ) { - printf("%s.%d lag.[%2d] RECV.%d %llx (%2d %llx) %llx/%llx matches.%d best.%d\n",dp->symbol,bp->height,(int32_t)(time(NULL)-channel),senderind,(long long)np->recvmask,(int8_t)np->bestk,(long long)np->bestmask,(long long)np->srcutxo.txid,(long long)np->destutxo.txid,matches,bestmatches); + printf("%s.%d lag.[%2d] %s RECV.%d %llx (%2d %llx) %llx/%llx matches.%d best.%d\n",dp->symbol,bp->height,(int32_t)(time(NULL)-channel),Notaries_elected[senderind][0],senderind,(long long)np->recvmask,(int8_t)np->bestk,(long long)np->bestmask,(long long)np->srcutxo.txid,(long long)np->destutxo.txid,matches,bestmatches); } } //dpow_bestmask_update(myinfo,dp,bp,nn_senderind,nn_bestk,nn_bestmask,nn_recvmask); diff --git a/iguana/m_notary_run b/iguana/m_notary_run index 92ffa8979..49273ebb3 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -60,3 +60,5 @@ coins/prlpay_7776 #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" sleep 30 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" +sleep 30 +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" From 937d07edab50674cbddb7223996e5d1530533770 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 May 2018 18:32:16 +0300 Subject: [PATCH 2/2] Prevent double notarization threads --- iguana/iguana_notary.c | 4 ++-- iguana/m_notary_run | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 09262465d..691bbc2d2 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -336,9 +336,9 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq) return(clonestr("{\"error\":\"cant dPoW KMD without BTC\"}")); else if ( iguana_coinfind(dest) == 0 ) return(clonestr("{\"error\":\"cant dPoW without KMD (dest)\"}")); - if ( myinfo->numdpows > 1 ) + if ( myinfo->numdpows > 0 ) { - for (i=1; inumdpows; i++) + for (i=0; inumdpows; i++) if ( strcmp(symbol,myinfo->DPOWS[i]->symbol) == 0 ) { dp->symbol[0] = 0; diff --git a/iguana/m_notary_run b/iguana/m_notary_run index 49273ebb3..92ffa8979 100755 --- a/iguana/m_notary_run +++ b/iguana/m_notary_run @@ -60,5 +60,3 @@ coins/prlpay_7776 #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" sleep 30 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" -sleep 30 -curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}"