jl777 8 years ago
parent
commit
9a5413b73f
  1. 23
      basilisk/basilisk_MSG.c
  2. 6
      iguana/iguana_notary.c
  3. 7
      iguana/notaries.h
  4. 1
      includes/iguana_funcs.h

23
basilisk/basilisk_MSG.c

@ -136,19 +136,34 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_
}
msgid--;
}
HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg)
{
if ( bits256_nonz(srchash) == 0 )
{
HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg)
if ( (msgjson= basilisk_msgjson(msg,msg->key,msg->keylen)) != 0 )
{
char *keystr,*hexstr,str[65],str2[65]; int32_t datalen; uint8_t data[1024],senderpub[33];
if ( (keystr= jstr(item,"key")) != 0 && is_hexstr(keystr,0) == BASILISK_KEYSIZE*2 && (hexstr= jstr(item,"data")) != 0 && (datalen= is_hexstr(hexstr,0)) > 0 )
{
bits256 hashmsg,txid,commit; int32_t vout;
decode_hex(key,BASILISK_KEYSIZE,keystr);
datalen >>= 1;
decode_hex(data,datalen,hexstr);
if ( datalen == 130 )
{
dpow_rwutxobuf(0,data,&hashmsg,&txid,&vout,&commit,senderpub);
printf("MSG hashmsg.(%s) txid.(%s) v%d\n",bits256_str(str,hashmsg),bits256_str(str2,txid),vout);
}
}
free_json(msgjson);
}
if ( basilisk_msgcmp(msg,origwidth,channel,origmsgid,zero,zero) == 0 )
{
if ( (msgjson= basilisk_msgjson(msg,msg->key,msg->keylen)) != 0 )
jaddi(array,msgjson);
}
}
}
HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg)
{
if ( now > msg->expiration+60 )
{
printf("delete expired message.%p QUEUEITEMS.%d\n",msg,QUEUEITEMS);

6
iguana/iguana_notary.c

@ -842,7 +842,7 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info
return(0xffffffff);
for (j=0; j<sizeof(srchash); j++)
srchash.bytes[j] = myinfo->DPOW.minerkey33[j+1];
printf("%s statemachine state.%d %s BTC.%d\n",coin->symbol,state,coinaddr,bits256_nonz(btctxid)==0);
printf("%s FSM.%d %s BTC.%d\n",coin->symbol,state,coinaddr,bits256_nonz(btctxid)==0);
switch ( state )
{
case 0:
@ -984,7 +984,7 @@ void dpow_statemachinestart(void *ptr)
}
if ( deststate != 0xffffffff )
{
printf("dp->ht.%d ht.%d DEST.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,deststate,bits256_str(str,srchash.hash));
//printf("dp->ht.%d ht.%d DEST.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,deststate,bits256_str(str,srchash.hash));
deststate = dpow_statemachineiterate(myinfo,dp,dest,deststate,srchash.hash,srchash.height,zero,notariesBTC,n,myind,&recvmaskBTC,&signedtxid,signedtx,timestamp,beacon);
}
if ( deststate == 0xffffffff )
@ -993,7 +993,7 @@ void dpow_statemachinestart(void *ptr)
{
//for (i=0; i<32; i++)
// signedtxid.bytes[i] = i;
printf("dp->ht.%d ht.%d SRC.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,srcstate,bits256_str(str,signedtxid));
//printf("dp->ht.%d ht.%d SRC.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,srcstate,bits256_str(str,signedtxid));
srcstate = dpow_statemachineiterate(myinfo,dp,src,srcstate,srchash.hash,srchash.height,signedtxid,notaries,n,myind,&recvmask,&signedtxid2,signedtx2,timestamp,beacon);
}
}

7
iguana/notaries.h

@ -24,12 +24,12 @@ char *Notaries[][2] =
//{ "movecrypto_EU", "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" },
//{ "pondsea_SH", "02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" },
//{ "jl777_testC", "020e0f6fe6e0fcdcac541eb728d6fe538a12adff20412b3c8a7fa892b223a47c2f" },
/*{ "badass_EU", "034ca7bf1b9f084643960525a01d96949f36fdca35fe27f88ae9b167d496a75aa2" },
/*{ "badass_EU", "02fef1aedce576f1b9b01c60dae2dc6530fd8f13e984b324bb12002b5f3933c397" },
{ "crackers_NA", "029e1c01131974f4cd3f564cc0c00eb87a0f9721043fbc1ca60f9bd0a1f73f64a1" },
{ "proto_EU", "03681ffdf17c8f4f0008cefb7fa0779c5e888339cdf932f0974483787a4d6747c1" },
{ "jeezy_EU", "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" },
{ "farl4web_EU", "035caa40684ace968677dca3f09098aa02b70e533da32390a7654c626e0cf908e1" },
{ "nxtswe_EU", "03e54828c23b3eba5ad9324160e75698b1298851c77c88dc094ba23105f69c2415" },
{ "nxtswe_EU", "032fb104e5eaa704a38a52c126af8f67e870d70f82977e5b2f093d5c1c21ae5899" },
{ "crackers_EU", "0340c66cf2c41c41efb420af57867baa765e8468c12aa996bfd816e1e07e410728" },
{ "traderbill_EU", "03196e8de3e2e5d872f31d79d6a859c8704a2198baf0af9c7b21e29656a7eb455f" },
{ "vanbreuk_EU", "024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" },
@ -38,6 +38,9 @@ char *Notaries[][2] =
{ "supernet_EU", "02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" },
{ "yassin_EU", "027804b371e4e1965e85311c99f6bf8d7160275f96d2f4312327396e4c476d36aa" },
{ "durerus_EU", "02cc82335371a57a2bbddf301ba4249e02da2e04d33aae9bfc54bf6752631a6372" },
{ "pondsea_EU", "0225aa6f6f19e543180b31153d9e6d55d41bc7ec2ba191fd29f19a2f973544e29d" },
{ "badass_SH", "0287fed7cd90994281f308ad112230d970c04148d7017e828fee47bfaf11c50679" },
{ "baddass_NA" "03df6bd57ff49a632be2a510dc83109ec90588f37f895b751c3b0f35712027c330" },
{ "Server1","0221876c8259764224dc1a7b70ec956f3fbe9a768cd77f13082cfa60eb6aa2d068"},
{ "Server2","03c7c14e6b1f94585bb571cf3ee5eb9b9ab54bd23d0acb8cf13edad1c515842b66"},
{ "Server3","02d28f8992ff0cd68c5d558cf55ec5b3ada25151519a6cea8cef1bac04c40023b6"},

1
includes/iguana_funcs.h

@ -496,6 +496,7 @@ int32_t iguana_inv2poll(struct supernet_info *myinfo,struct iguana_info *coin);
struct iguana_bundlereq *iguana_bundlereq(struct iguana_info *coin,struct iguana_peer *addr,int32_t type,uint8_t *data,int32_t datalen);
void instantdex_FSMinit();
int32_t datachain_opreturnscript(struct iguana_info *coin,uint8_t *script,char *datastr,int32_t datalen);
int32_t dpow_rwutxobuf(int32_t rwflag,uint8_t *data,bits256 *hashmsg,bits256 *txid,int32_t *voutp,bits256 *commit,uint8_t *senderpub);
cJSON *basilisk_channelget(struct supernet_info *myinfo,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgid,int32_t width);
int32_t basilisk_channelsend(struct supernet_info *myinfo,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgid,uint8_t *data,int32_t datalen,uint32_t duration);
cJSON *dpow_listunspent(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr);

Loading…
Cancel
Save