Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
8cc48f33ef
  1. 2
      basilisk/basilisk.c
  2. 8
      basilisk/basilisk_swap.c

2
basilisk/basilisk.c

@ -209,7 +209,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
continue; continue;
if ( s == n && (addr->supernet != 0 || addr->basilisk != 0) && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) ) if ( s == n && (addr->supernet != 0 || addr->basilisk != 0) && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) )
{ {
printf("i.%d l.%d [%s].tag%d send %s.(%s) [%x] datalen.%d addr->supernet.%u basilisk.%u to (%s).%d destip.%s\n",i,l,cmd,*(uint32_t *)data,type,(char *)&data[4],*(int32_t *)&data[datalen-4],datalen,addr->supernet,addr->basilisk,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast"); //printf("i.%d l.%d [%s].tag%d send %s.(%s) [%x] datalen.%d addr->supernet.%u basilisk.%u to (%s).%d destip.%s\n",i,l,cmd,*(uint32_t *)data,type,(char *)&data[4],*(int32_t *)&data[datalen-4],datalen,addr->supernet,addr->basilisk,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast");
if ( encryptflag != 0 && bits256_nonz(addr->pubkey) != 0 ) if ( encryptflag != 0 && bits256_nonz(addr->pubkey) != 0 )
{ {
void *ptr; uint8_t *cipher,space[8192]; int32_t cipherlen; bits256 privkey; void *ptr; uint8_t *cipher,space[8192]; int32_t cipherlen; bits256 privkey;

8
basilisk/basilisk_swap.c

@ -314,16 +314,16 @@ int32_t basilisk_rawtx_spendscript(struct supernet_info *myinfo,int32_t height,s
int32_t basilisk_swapuserdata(uint8_t *userdata,int32_t pushpriv,bits256 privkey,uint8_t addrtype,bits256 pubkey,int32_t ifpath) int32_t basilisk_swapuserdata(uint8_t *userdata,int32_t pushpriv,bits256 privkey,uint8_t addrtype,bits256 pubkey,int32_t ifpath)
{ {
int32_t i,len = 0; int32_t i,len = 0;
userdata[len++] = 33;
userdata[len++] = addrtype;
for (i=0; i<sizeof(pubkey); i++)
userdata[len++] = pubkey.bytes[i];
if ( pushpriv != 0 ) if ( pushpriv != 0 )
{ {
userdata[len++] = sizeof(privkey); userdata[len++] = sizeof(privkey);
for (i=0; i<sizeof(privkey); i++) for (i=0; i<sizeof(privkey); i++)
userdata[len++] = privkey.bytes[sizeof(privkey) - 1 - i]; userdata[len++] = privkey.bytes[sizeof(privkey) - 1 - i];
} }
userdata[len++] = 33;
userdata[len++] = addrtype;
for (i=0; i<sizeof(pubkey); i++)
userdata[len++] = pubkey.bytes[i];
userdata[len++] = 0x51 * ifpath; // ifpath == 1 -> if path, 0 -> else path userdata[len++] = 0x51 * ifpath; // ifpath == 1 -> if path, 0 -> else path
return(len); return(len);
} }

Loading…
Cancel
Save