Browse Source

GMC

release/v0.1
jl777 8 years ago
parent
commit
267f6a65a3
  1. 13
      basilisk/basilisk.c
  2. 1
      iguana/coins/gengmc
  3. 23
      iguana/confs/GMC_peers.txt
  4. 2
      iguana/iguana_msg.c

13
basilisk/basilisk.c

@ -147,7 +147,7 @@ struct basilisk_item *basilisk_itemcreate(struct supernet_info *myinfo,char *CMD
int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *type,uint32_t *basilisktagp,int32_t encryptflag,int32_t delaymillis,uint8_t *data,int32_t datalen,int32_t fanout,uint32_t nBits) // data must be offset by sizeof(iguana_msghdr)+sizeof(basilisktag)
{
int32_t i,r,l,s,valid,val,n=0,retval = -1; char cmd[12]; struct iguana_info *coin,*tmp; struct iguana_peer *addr; bits256 hash; uint32_t *alreadysent;
int32_t i,l,s,valid,val,n=0,retval = -1; char cmd[12]; struct iguana_info *coin,*tmp; struct iguana_peer *addr; bits256 hash; uint32_t *alreadysent,r,r2;
if ( fanout <= 0 )
fanout = sqrt(NUMRELAYS) + 1;
else if ( fanout > BASILISK_MAXFANOUT )
@ -201,8 +201,15 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
else valid = 0;
if ( addr->usock >= 0 )
{
if ( basilisk_specialcmd(type) != 0 )
s = 0;
if ( NUMRELAYS > 0 && basilisk_specialcmd(type) != 0 )
{
OS_randombytes((void *)&r2,sizeof(r2));
if ( (r2 % NUMRELAYS) >= sqrt(NUMRELAYS) )
{
//printf("fanout.%d s.%d n.%d skip %s\n",fanout,s,n,addr->ipaddr);
continue;
}
for (s=0; s<NUMRELAYS; s++)
if ( addr->ipbits != myinfo->myaddr.myipbits && RELAYS[s].ipbits == addr->ipbits )
break;
@ -408,7 +415,7 @@ char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_add
}
ptr->finished = (uint32_t)time(NULL);
}
if ( 1 && strcmp("RID",CMD) != 0 && strcmp("BAL",CMD) != 0 )
if ( 1 && strcmp("RID",CMD) != 0 && strcmp("BAL",CMD) != 0 && strcmp("MSG",CMD) != 0 )
printf("%s.(%s) -> (%s)\n",CMD,jprint(valsobj,0),retstr!=0?retstr:"");
return(retstr);
}

1
iguana/coins/gengmc

@ -0,0 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"GMC\",\"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}"

23
iguana/confs/GMC_peers.txt

@ -0,0 +1,23 @@
104.236.84.230
142.4.218.175
58.168.10.110
101.173.217.38
194.135.81.138
80.229.155.158
85.214.23.49
104.168.148.143
46.105.118.15
198.27.97.172
101.173.200.202
89.36.212.56
45.48.9.204
104.172.24.79
85.25.200.157
216.146.143.177
203.7.43.162
101.173.197.85
111.99.55.252
192.52.166.35
193.192.37.135
209.126.119.209
155.254.49.27

2
iguana/iguana_msg.c

@ -350,7 +350,7 @@ int32_t iguana_send_version(struct iguana_info *coin,struct iguana_peer *addr,ui
{
int32_t len; struct iguana_msgversion msg; uint8_t serialized[sizeof(struct iguana_msghdr)+sizeof(msg)];
memset(&msg,0,sizeof(msg));
msg.nVersion = PROTOCOL_VERSION;
msg.nVersion = coin->chain->protover;//PROTOCOL_VERSION;
msg.nServices = (myservices & NODE_NETWORK);
msg.nTime = (int64_t)time(NULL);
msg.nonce = coin->instance_nonce;

Loading…
Cancel
Save