Browse Source

Merge pull request #836 from jl777/jl777

Jl777
pass-iguana-arg
jl777 7 years ago
committed by GitHub
parent
commit
37128e8fcc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      iguana/coins/game_7776
  2. 4
      iguana/dpow/dpow_fsm.c
  3. 4
      iguana/dpow/dpow_network.c
  4. 2
      iguana/dpow/dpow_rpc.c
  5. 1
      iguana/exchanges/LP_swap.c
  6. 2
      iguana/exchanges/coins
  7. 18
      iguana/iguana_notary.c
  8. 1
      iguana/m_notary_run

2
iguana/coins/game_7776

@ -0,0 +1,2 @@
#!/bin/bash
curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"gamecredits.conf\",\"path\":\"${HOME#"/"}/.gamecredits\",\"startpend\":8,\"endpend\":4,\"services\":129,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"GAME\",\"name\":\"gamecredits\",\"netmagic\":\"fbc0b6db\",\"p2p\":40002,\"rpc\":40001,\"pubval\":38,\"p2shval\":5,\"wifval\":166,\"txfee_satoshis\":\"100000\",\"minconfirms\":2,\"genesishash\":\"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1392757140,\"nBits\":\"1e0ffff0\",\"nonce\":2084565393,\"merkle_root\":\"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429\"},\"alertpubkey\":\"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284\",\"auxpow\":1,\"protover\":80006,\"isPoS\":0,\"fixit\":0}"

4
iguana/dpow/dpow_fsm.c

@ -495,7 +495,7 @@ void dpow_statemachinestart(void *ptr)
bp->myind = myind;
while ( bp->isratify == 0 && dp->destupdated == 0 )
{
if ( (checkpoint.blockhash.height % 100) != 0 && dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) //(checkpoint.blockhash.height % 100) != 0 &&
{
//printf("abort %s ht.%d due to new checkpoint.%d\n",dp->symbol,checkpoint.blockhash.height,dp->checkpoint.blockhash.height);
dp->ratifying -= bp->isratify;
@ -535,7 +535,7 @@ void dpow_statemachinestart(void *ptr)
extralen = dpow_paxpending(extras,sizeof(extras),&bp->paxwdcrc,bp->MoM,bp->MoMdepth,src_or_dest,bp);
bp->notaries[bp->myind].paxwdcrc = bp->paxwdcrc;
}
if ( (checkpoint.blockhash.height % 100) != 0 && dp->checkpoint.blockhash.height > checkpoint.blockhash.height )
if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) //(checkpoint.blockhash.height % 100) != 0 &&
{
if ( bp->isratify == 0 )
{

4
iguana/dpow/dpow_network.c

@ -1537,7 +1537,7 @@ void dpow_bestconsensus(struct dpow_info *dp,struct dpow_block *bp)
bp->bestmatches = bestmatches;
bp->notaries[bp->myind].bestmask = bp->bestmask = masks[besti];
bp->notaries[bp->myind].bestk = bp->bestk = bestks[besti];
if ( bp->myind == 0 && strcmp("KMD",dp->symbol) == 0 )
if ( 0 && bp->myind == 0 && strcmp("KMD",dp->symbol) == 0 )
{
for (i=0; i<bp->numnotaries; i++)
printf("%d:%d%s ",wts[i],owts[i],wts[i]*owts[i]>median?"*":"");
@ -1960,7 +1960,7 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru
printf("mypaxcrc.%x\n",bp->paxwdcrc);
}
char str[65];
if ( (rand() % 130) == 0 )//|| strcmp(dp->symbol,"KMD") == 0 )
if ( (rand() % 1024) == 0 )//|| strcmp(dp->symbol,"KMD") == 0 )
printf("%p ht.%d [%d] ips.%d %s NOTARIZE.%d matches.%d paxmatches.%d bestmatches.%d bestk.%d %llx recv.%llx sigmasks.(%llx %llx) senderind.%d state.%x (%x %x %x) MoM.%s [%d]\n",bp,bp->height,bp->myind,dp->numipbits,dp->symbol,bp->minsigs,matches,paxmatches,bestmatches,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),(long long)(bp->bestk>=0?bp->srcsigsmasks[bp->bestk]:0),senderind,bp->state,bp->hashmsg.uints[0],bp->desttxid.uints[0],bp->srctxid.uints[0],bits256_str(str,bp->MoM),bp->MoMdepth);
}
}

2
iguana/dpow/dpow_rpc.c

@ -380,6 +380,8 @@ char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin
{
sprintf(buf,"\"%s\"",address);
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,coin->validateaddress,buf);
//printf("%s %s %s %s %s\n",coin->symbol,coin->chain->serverport,coin->chain->userpass,coin->validateaddress,buf);
//printf("%s -> (%s)\n",buf,retstr!=0?retstr:"null");
if ( (retjson= cJSON_Parse(retstr)) != 0 )
{
if ( strcmp(coin->symbol,"BTC") == 0 && jobj(retjson,"error") == 0 && jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 )

1
iguana/exchanges/LP_swap.c

@ -705,6 +705,7 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3
{
if ( bits256_nonz(rawtx->I.signedtxid) != 0 && bits256_nonz(rawtx->I.actualtxid) == 0 )
{
basilisk_dontforget_update(swap,rawtx);
rawtx->I.actualtxid = LP_broadcast_tx(rawtx->name,rawtx->symbol,rawtx->txbytes,rawtx->I.datalen);
if ( bits256_cmp(rawtx->I.actualtxid,rawtx->I.signedtxid) != 0 )
{

2
iguana/exchanges/coins

File diff suppressed because one or more lines are too long

18
iguana/iguana_notary.c

@ -143,7 +143,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he
printf("ht.%d maxblocks.%d\n",ht,dp->maxblocks);
for (i=ht-DPOW_MAXFREQ*5; i>ht-DPOW_MAXFREQ*100&&i>DPOW_MAXFREQ; i--)
{
if ( (i % DPOW_MAXFREQ) != 0 && (bp= dp->blocks[i]) != 0 && bp->state == 0xffffffff )
if ( (bp= dp->blocks[i]) != 0 && bp->state == 0xffffffff ) //(i % DPOW_MAXFREQ) != 0 &&
{
if ( dp->currentbp == dp->blocks[i] )
dp->currentbp = 0;
@ -388,20 +388,28 @@ THREE_STRINGS_AND_DOUBLE(iguana,dpow,symbol,dest,pubkey,freq)
json = cJSON_Parse(retstr);
if ( (ismine= jobj(json,"ismine")) != 0 && is_cJSON_True(ismine) != 0 )
srcvalid = 1;
else srcvalid = 0;
else
{
srcvalid = 0;
printf("src validation error %s %s %s\n",src->symbol,srcaddr,retstr);
}
free(retstr);
retstr = 0;
}
} else printf("%s %s didnt return anything\n",src->symbol,srcaddr);
bitcoin_address(destaddr,destcoin->chain->pubtype,dp->minerkey33,33);
if ( (retstr= dpow_validateaddress(myinfo,destcoin,destaddr)) != 0 )
{
json = cJSON_Parse(retstr);
if ( (ismine= jobj(json,"ismine")) != 0 && is_cJSON_True(ismine) != 0 )
destvalid = 1;
else destvalid = 0;
else
{
destvalid = 0;
printf("dest validation error %s %s %s\n",src->symbol,srcaddr,retstr);
}
free(retstr);
retstr = 0;
}
} else printf("%s %s didnt return anything\n",destcoin->symbol,destaddr);
if ( srcvalid <= 0 || destvalid <= 0 )
{
dp->symbol[0] = 0;

1
iguana/m_notary_run

@ -28,6 +28,7 @@ coins/btc_7776
#coins/ltc_7776
coins/kmd_7776
coins/chips_7776
coins/game_7776
./wp_7776
coins/revs_7776

Loading…
Cancel
Save