jl777 8 years ago
parent
commit
adb531f0d0
  1. 13
      iguana/iguana_notary.c
  2. 2
      iguana/notaries.h
  3. 13
      iguana/tests/addnotarys_7776

13
iguana/iguana_notary.c

@ -786,9 +786,9 @@ void dpow_handler(struct supernet_info *myinfo,struct basilisk_message *msg)
} }
} else printf("%s beacon mismatch for senderind.%d %llx vs %llx\n",bp->coin->symbol,dsig.senderind,*(long long *)dsig.senderpub,*(long long *)bp->notaries[dsig.senderind].pubkey); } else printf("%s beacon mismatch for senderind.%d %llx vs %llx\n",bp->coin->symbol,dsig.senderind,*(long long *)dsig.senderpub,*(long long *)bp->notaries[dsig.senderind].pubkey);
} else printf("%s illegal lastk.%d or senderind.%d or senderpub.%llx\n",bp->coin->symbol,dsig.lastk,dsig.senderind,*(long long *)dsig.senderpub); } else printf("%s illegal lastk.%d or senderind.%d or senderpub.%llx\n",bp->coin->symbol,dsig.lastk,dsig.senderind,*(long long *)dsig.senderpub);
} else printf("%s couldnt find senderind.%d height.%d channel.%x\n",bp->coin->symbol,dsig.senderind,height,channel); } else printf("couldnt find senderind.%d height.%d channel.%x\n",dsig.senderind,height,channel);
if ( 0 && flag == 0 ) if ( 0 && flag == 0 )
printf("%s SIG.%d sender.%d lastk.%d mask.%llx siglen.%d\n",bp->coin->symbol,height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen); printf(" SIG.%d sender.%d lastk.%d mask.%llx siglen.%d\n",height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen);
} }
else if ( channel == DPOW_TXIDCHANNEL || channel == DPOW_BTCTXIDCHANNEL ) else if ( channel == DPOW_TXIDCHANNEL || channel == DPOW_BTCTXIDCHANNEL )
{ {
@ -919,6 +919,7 @@ void dpow_statemachinestart(void *ptr)
memset(&zero,0,sizeof(zero)); memset(&zero,0,sizeof(zero));
myinfo = ptrs[0]; myinfo = ptrs[0];
dp = ptrs[1]; dp = ptrs[1];
dp->destupdated = 0; // prevent another state machine till next BTC block
memcpy(&checkpoint,&ptrs[2],sizeof(checkpoint)); memcpy(&checkpoint,&ptrs[2],sizeof(checkpoint));
printf("statemachinestart %s->%s %s ht.%d\n",dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height); printf("statemachinestart %s->%s %s ht.%d\n",dp->symbol,dp->dest,bits256_str(str,checkpoint.blockhash.hash),checkpoint.blockhash.height);
src = iguana_coinfind(dp->symbol); src = iguana_coinfind(dp->symbol);
@ -946,6 +947,7 @@ void dpow_statemachinestart(void *ptr)
dp->srcblocks[checkpoint.blockhash.height] = srcbp; dp->srcblocks[checkpoint.blockhash.height] = srcbp;
srcbp->beacon = destbp->beacon; srcbp->beacon = destbp->beacon;
srcbp->commit = destbp->commit; srcbp->commit = destbp->commit;
printf("create srcbp[%d]\n",checkpoint.blockhash.height);
if ( (bp= dp->srcblocks[checkpoint.blockhash.height - 1000]) != 0 ) if ( (bp= dp->srcblocks[checkpoint.blockhash.height - 1000]) != 0 )
{ {
printf("purge %s.%d\n",dp->symbol,checkpoint.blockhash.height - 1000); printf("purge %s.%d\n",dp->symbol,checkpoint.blockhash.height - 1000);
@ -990,19 +992,16 @@ void dpow_statemachinestart(void *ptr)
if ( destbp->state == 0xffffffff ) if ( destbp->state == 0xffffffff )
{ {
srcbp->btctxid = destbp->signedtxid; srcbp->btctxid = destbp->signedtxid;
dp->destupdated = 0;
printf("SET BTCTXID.(%s)\n",bits256_str(str,srcbp->btctxid)); printf("SET BTCTXID.(%s)\n",bits256_str(str,srcbp->btctxid));
} }
} }
if ( destbp->state == 0xffffffff ) if ( destbp->state == 0xffffffff && bits256_nonz(srcbp->btctxid) != 0 )
{ {
srcbp->state = 0xffffffff; //srcbp->state = 0xffffffff;
if ( srcbp->state != 0xffffffff ) if ( srcbp->state != 0xffffffff )
{ {
//printf("dp->ht.%d ht.%d SRC.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,srcbp->state,bits256_str(str,srcbp->btctxid)); //printf("dp->ht.%d ht.%d SRC.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,srcbp->state,bits256_str(str,srcbp->btctxid));
srcbp->state = dpow_statemachineiterate(myinfo,dp,src,srcbp,myind); srcbp->state = dpow_statemachineiterate(myinfo,dp,src,srcbp,myind);
if ( srcbp->state == 0xffffffff )
dp->destupdated = 0;
} }
} }
} }

2
iguana/notaries.h

@ -22,7 +22,7 @@ char *Notaries[][2] =
{ "jl777_testB", "02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" }, { "jl777_testB", "02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" },
//{ "jl777_testC", "020e0f6fe6e0fcdcac541eb728d6fe538a12adff20412b3c8a7fa892b223a47c2f" }, //{ "jl777_testC", "020e0f6fe6e0fcdcac541eb728d6fe538a12adff20412b3c8a7fa892b223a47c2f" },
{ "locomb_EU", "025c6d26649b9d397e63323d96db42a9d3caad82e1d6076970efe5056c00c0779b" }, { "locomb_EU", "025c6d26649b9d397e63323d96db42a9d3caad82e1d6076970efe5056c00c0779b" },
{ "fullmoon_AE", "020d73d3aedc9998ac0fab7c55eaf5f9c96a7518773057dee95533ae0ff7e51ab4" }, { "fullmoon_AE", "0204a908350b8142698fdb6fabefc97fe0e04f537adc7522ba7a1e8f3bec003d4a" },
{ "movecrypto_EU", "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" }, { "movecrypto_EU", "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" },
{ "pondsea_SH", "02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" }, { "pondsea_SH", "02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" },
{ "badass_EU", "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, { "badass_EU", "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" },

13
iguana/tests/addnotarys_7776

@ -1,5 +1,18 @@
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"5.9.102.210\"}" curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"5.9.102.210\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"78.47.196.146\"}" curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"78.47.196.146\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"149.56.29.163\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.226\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.217\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.208\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.200\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.199\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"27.100.36.201\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.218\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.102.63.227\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"149.202.65.200\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"80.28.255.124\"}"
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"221.121.144.138\"}"
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"89.40.125.53\"}" #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"89.40.125.53\"}"
#curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.177.224.130\"}" #curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"94.177.224.130\"}"

Loading…
Cancel
Save