Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
2b5e47f04e
  1. 6
      crypto777/iguana_serdes.c
  2. 11
      iguana/iguana_ramchain.c

6
crypto777/iguana_serdes.c

@ -170,19 +170,19 @@ int32_t iguana_rwvarint(int32_t rwflag,uint8_t *serialized,uint64_t *varint64p)
n = *varint64p;
if ( n < 0xfd )
*serialized++ = (uint8_t)n;
else if ( n >= 0xfd && n <= 0xffff )
else if ( n <= 0xffff )
{
*serialized++ = 0xfd;
iguana_varint16(rwflag,serialized,(uint16_t *)varint64p);
vlen += 2;
}
else if ( n > 0xffff && n <= 0xffffffff )
else if ( n <= 0xffffffff )
{
*serialized++ = 0xfe;
iguana_varint32(rwflag,serialized,(uint16_t *)varint64p);
vlen += 4;
}
else if ( n > 0xffffffff )
else
{
*serialized++ = 0xff;
iguana_varint64(rwflag,serialized,(uint32_t *)varint64p);

11
iguana/iguana_ramchain.c

@ -519,9 +519,9 @@ uint32_t iguana_ramchain_pubkeyoffset(struct iguana_info *coin,RAMCHAIN_FUNC,int
if ( (plen= bitcoin_pubkeylen(pubkey)) > 0 )
{
P[pkind].pubkeyoffset = *scriptoffsetp, *scriptoffsetp += plen;
//int32_t i; for (i=0; i<plen; i++)
// printf("%02x",pubkey[i]);
//printf(" plen.%d -> new offset.%d\n",plen,*scriptoffsetp);
int32_t i; for (i=0; i<plen; i++)
printf("%02x",pubkey[i]);
printf(" plen.%d -> new offset.%d\n",plen,*scriptoffsetp);
memcpy(&Kspace[P[pkind].pubkeyoffset],pubkey,plen);
}
else
@ -690,9 +690,12 @@ int32_t iguana_vinscriptencode(struct iguana_info *coin,uint8_t *Kstackend,uint3
}
if ( s->numpubkeys > 0 )
{
printf("metalen.%d\n",len);
for (i=0; i<s->numpubkeys; i++)
{
len += iguana_rwvarint32(1,&metascript[len],&poffsets[i]);
printf("EMIT pubkey.%d len.%d\n",poffsets[0],len);
printf("EMIT pubkey poffsets.[%x] len.%d\n",poffsets[0],len);
}
}
if ( p2shlen != 0 )
{

Loading…
Cancel
Save