Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
add12fb915
  1. 4
      crypto777/OS_portable.h
  2. 10
      crypto777/iguana_serdes.c
  3. 2
      iguana/iguana_msg.c
  4. 3
      iguana/iguana_rpc.c
  5. 7
      iguana/main.c

4
crypto777/OS_portable.h

@ -149,7 +149,6 @@ void *OS_portable_mapfile(char *fname,long *filesizep,int32_t enablewrite);
int32_t OS_portable_syncmap(struct OS_mappedptr *mp,long len);
void *OS_portable_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long origsize);
int32_t is_DST(int32_t datenum);
int32_t extract_datenum(int32_t *yearp,int32_t *monthp,int32_t *dayp,int32_t datenum);
int32_t expand_datenum(char *date,int32_t datenum);
@ -206,7 +205,6 @@ void *iguana_meminit(struct OS_memspace *mem,char *name,void *ptr,int64_t totals
void *iguana_memalloc(struct OS_memspace *mem,long size,int32_t clearflag);
int64_t iguana_memfree(struct OS_memspace *mem,void *ptr,int32_t size);
// generic functions
int32_t unhex(char c);
void touppercase(char *str);
@ -313,5 +311,7 @@ bits256 bits256_from_compact(uint32_t c);
int32_t btc_priv2pub(uint8_t pubkey[33],uint8_t privkey[32]);
extern char *Iguana_validcommands[];
#endif

10
crypto777/iguana_serdes.c

@ -54,13 +54,9 @@ int32_t iguana_rwnum(int32_t rwflag,uint8_t *serialized,int32_t len,void *endian
int32_t iguana_validatehdr(struct iguana_msghdr *H)
{
int32_t i,len; char *validcommands[] =
{
"SuperNET", "version", "verack", "getaddr", "addr", "inv", "getdata", "notfound", "getblocks", "getheaders",
"headers", "tx", "block", "mempool", "ping", "pong", "reject", "filterload", "filteradd", "filterclear", "merkleblock", "alert"
};
for (i=0; i<sizeof(validcommands)/sizeof(*validcommands); i++)
if ( strcmp(H->command,validcommands[i]) == 0 )
int32_t i,len;
for (i=0; Iguana_validcommands[i]!=0&&Iguana_validcommands[i][0]!=0; i++)
if ( strcmp(H->command,Iguana_validcommands[i]) == 0 )
{
iguana_rwnum(0,H->serdatalen,sizeof(H->serdatalen),(uint32_t *)&len);
if ( len > IGUANA_MAXPACKETSIZE )

2
iguana/iguana_msg.c

@ -429,7 +429,7 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc
strcpy(addr->lastcommand,H->command);
}
retval = 0;
//printf("iguana_msgparser %s parse.(%s)\n",addr->ipaddr,H->command);
printf("iguana_msgparser %s parse.(%s)\n",addr->ipaddr,H->command);
if ( strncmp(H->command,"SuperNET",strlen("SuperNET")) == 0 )
{
addr->supernet = 1;

3
iguana/iguana_rpc.c

@ -471,6 +471,8 @@ static char *getrawchangeaddress(RPCARGS)
#define false 0
struct RPC_info { char *name; char *(*rpcfunc)(RPCARGS); int32_t flag0,remoteflag; } RPCcalls[] =
{
{ "SuperNET", &SuperNET, false, true },
//{ "SuperNETb", &SuperNET, false, true },
{ "help", &help, true, false },
{ "stop", &stop, true, true },
{ "getbestblockhash", &getbestblockhash, true, true },
@ -512,7 +514,6 @@ struct RPC_info { char *name; char *(*rpcfunc)(RPCARGS); int32_t flag0,remotefla
{ "settxfee", &settxfee, false, false },
{ "listsinceblock", &listsinceblock, false, false },
{ "dumpprivkey", &dumpprivkey, false, false },
{ "SuperNET", &SuperNET, false, true },
{ "dumpwallet", &dumpwallet, true, false },
{ "importwallet", &importwallet, false, false },
{ "importprivkey", &importprivkey, false, false },

7
iguana/main.c

@ -25,6 +25,13 @@
#include "SuperNET.h"
// ALL globals must be here!
char *Iguana_validcommands[] =
{
"SuperNET", "SuperNETb",
"version", "verack", "getaddr", "addr", "inv", "getdata", "notfound", "getblocks", "getheaders", "headers", "tx", "block", "mempool", "ping", "pong",
"reject", "filterload", "filteradd", "filterclear", "merkleblock", "alert", ""
};
struct iguana_info *Coins[IGUANA_MAXCOINS];
int32_t USE_JAY,FIRST_EXTERNAL,IGUANA_disableNXT,Debuglevel;
uint32_t prices777_NXTBLOCK,MAX_DEPTH = 100;

Loading…
Cancel
Save