From a48ce33f6f47d1a2376976de449135a785412d6d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 15 Sep 2016 17:41:31 -0300 Subject: [PATCH] test minconfirms --- iguana/coins/genanc | 0 iguana/coins/genanc.json | 0 iguana/coins/genbtcd | 2 +- iguana/coins/genbtm | 0 iguana/coins/genbtm.json | 0 iguana/coins/gencarb | 0 iguana/coins/gencarb.json | 0 iguana/coins/genfrk | 0 iguana/coins/genfrk.json | 0 iguana/coins/genvia | 0 iguana/iguana_chains.c | 2 +- iguana/iguana_realtime.c | 4 ++-- iguana/iguana_spendvectors.c | 4 ++-- iguana/iguana_tx.c | 2 +- iguana/tests/json_extract.c | 0 iguana/tests/json_extracta.c | 0 iguana/tests/json_extractd.c | 0 iguana/tests/json_extracti.c | 0 iguana/tests/jsoncmp.c | 0 iguana/tests/peers.txt | 0 iguana/tests/txdata | 0 21 files changed, 7 insertions(+), 7 deletions(-) mode change 100644 => 100755 iguana/coins/genanc mode change 100644 => 100755 iguana/coins/genanc.json mode change 100644 => 100755 iguana/coins/genbtm mode change 100644 => 100755 iguana/coins/genbtm.json mode change 100644 => 100755 iguana/coins/gencarb mode change 100644 => 100755 iguana/coins/gencarb.json mode change 100644 => 100755 iguana/coins/genfrk mode change 100644 => 100755 iguana/coins/genfrk.json mode change 100644 => 100755 iguana/coins/genvia mode change 100644 => 100755 iguana/tests/json_extract.c mode change 100644 => 100755 iguana/tests/json_extracta.c mode change 100644 => 100755 iguana/tests/json_extractd.c mode change 100644 => 100755 iguana/tests/json_extracti.c mode change 100644 => 100755 iguana/tests/jsoncmp.c mode change 100644 => 100755 iguana/tests/peers.txt mode change 100644 => 100755 iguana/tests/txdata diff --git a/iguana/coins/genanc b/iguana/coins/genanc old mode 100644 new mode 100755 diff --git a/iguana/coins/genanc.json b/iguana/coins/genanc.json old mode 100644 new mode 100755 diff --git a/iguana/coins/genbtcd b/iguana/coins/genbtcd index 4b7a595eb..0278e1725 100755 --- a/iguana/coins/genbtcd +++ b/iguana/coins/genbtcd @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632}" +curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"minconfirms\":7}" diff --git a/iguana/coins/genbtm b/iguana/coins/genbtm old mode 100644 new mode 100755 diff --git a/iguana/coins/genbtm.json b/iguana/coins/genbtm.json old mode 100644 new mode 100755 diff --git a/iguana/coins/gencarb b/iguana/coins/gencarb old mode 100644 new mode 100755 diff --git a/iguana/coins/gencarb.json b/iguana/coins/gencarb.json old mode 100644 new mode 100755 diff --git a/iguana/coins/genfrk b/iguana/coins/genfrk old mode 100644 new mode 100755 diff --git a/iguana/coins/genfrk.json b/iguana/coins/genfrk.json old mode 100644 new mode 100755 diff --git a/iguana/coins/genvia b/iguana/coins/genvia old mode 100644 new mode 100755 diff --git a/iguana/iguana_chains.c b/iguana/iguana_chains.c index 439232368..6e8911ea6 100755 --- a/iguana/iguana_chains.c +++ b/iguana/iguana_chains.c @@ -385,7 +385,7 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c decode_hex((uint8_t *)&chain->wiftype,1,hexstr); } } - printf("addrtypes.(%02x %02x %02x) (%d %d %d)\n",chain->pubtype,chain->p2shtype,chain->wiftype,chain->pubtype,chain->p2shtype,chain->wiftype); + printf("MINCONFIRMS.%d addrtypes.(%02x %02x %02x) (%d %d %d)\n",chain->minconfirms,chain->pubtype,chain->p2shtype,chain->wiftype,chain->pubtype,chain->p2shtype,chain->wiftype); if ( (hexstr= jstr(argjson,"netmagic")) != 0 && strlen(hexstr) == 8 ) decode_hex((uint8_t *)chain->netmagic,4,hexstr); if ( (hexstr= jstr(argjson,"unitval")) != 0 && strlen(hexstr) == 2 ) diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index b9bb9af06..28e9dbc9c 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -768,9 +768,9 @@ void iguana_RTnewblock(struct supernet_info *myinfo,struct iguana_info *coin,str iguana_RTbalance_verify("start iterate",coin); if ( strcmp(coin->symbol,"BTC") != 0 && strcmp(coin->symbol,"LTC") != 0 ) { - if ( block->height < coin->firstRTheight+2 ) + if ( block->height < coin->firstRTheight+coin->minconfirms ) return; - if ( (block= iguana_blockfind("RTnew",coin,iguana_blockhash(coin,block->height-2))) == 0 ) + if ( (block= iguana_blockfind("RTnew",coin,iguana_blockhash(coin,block->height-coin->minconfirms))) == 0 ) return; } if ( block->height < coin->firstRTheight || block->height >= coin->firstRTheight+sizeof(coin->RTblocks)/sizeof(*coin->RTblocks) ) diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index ce711bbf6..214bac07d 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -1140,7 +1140,7 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c if ( (len= iguana_peerblockrequest(myinfo,coin,blockspace,max,0,bp->hashes[i],1)) < 0 ) { errs++; - printf("bundlevalidate: delete [%d:%d]\n",bp->hdrsi,i); + printf("bundlevalidate: %s delete [%d:%d]\n",coin->symbol,bp->hdrsi,i); iguana_blockunmark(coin,bp->blocks[i],bp,i,1); totalerrs++; } @@ -1151,7 +1151,7 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c } } free(blockspace); - printf("VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid); + printf("%s VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",coin->symbol,bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid); if ( totalerrs == 0 ) bp->validated = (uint32_t)time(NULL); else bp->startutxo = bp->utxofinish = 0; diff --git a/iguana/iguana_tx.c b/iguana/iguana_tx.c index 5fee72cf7..8d885c817 100755 --- a/iguana/iguana_tx.c +++ b/iguana/iguana_tx.c @@ -337,7 +337,7 @@ int32_t iguana_peerblockrequest(struct supernet_info *myinfo,struct iguana_info //printf("validated.[%d:%d] len.%d\n",bp->hdrsi,bundlei,total); return(total); } - } else printf("iguana_peerblockrequest: error merkle cmp tx.[%d] for ht.%d\n",i,bp->bundleheight+bundlei); + } else printf("iguana_peerblockrequest: %s error merkle cmp tx.[%d] for ht.%d\n",coin->symbol,i,bp->bundleheight+bundlei); } else printf("iguana_peerblockrequest: error merkle verify tx.[%d] for ht.%d\n",i,bp->bundleheight+bundlei); } else printf("%s iguana_peerblockrequest: error getting tx.[%d] for ht.%d block.%p main.%d ht.%d\n",coin->symbol,i,bp->bundleheight+bundlei,block,block!=0?block->mainchain:-1,block!=0?block->height:-1); } diff --git a/iguana/tests/json_extract.c b/iguana/tests/json_extract.c old mode 100644 new mode 100755 diff --git a/iguana/tests/json_extracta.c b/iguana/tests/json_extracta.c old mode 100644 new mode 100755 diff --git a/iguana/tests/json_extractd.c b/iguana/tests/json_extractd.c old mode 100644 new mode 100755 diff --git a/iguana/tests/json_extracti.c b/iguana/tests/json_extracti.c old mode 100644 new mode 100755 diff --git a/iguana/tests/jsoncmp.c b/iguana/tests/jsoncmp.c old mode 100644 new mode 100755 diff --git a/iguana/tests/peers.txt b/iguana/tests/peers.txt old mode 100644 new mode 100755 diff --git a/iguana/tests/txdata b/iguana/tests/txdata old mode 100644 new mode 100755