|
@ -53,7 +53,7 @@ int32_t iguana_vinparse(struct iguana_info *coin,int32_t rwflag,uint8_t *seriali |
|
|
printf("iguana_vinparse illegal scriptlen.%d\n",msg->scriptlen); |
|
|
printf("iguana_vinparse illegal scriptlen.%d\n",msg->scriptlen); |
|
|
return(-1); |
|
|
return(-1); |
|
|
} |
|
|
} |
|
|
printf("len.%d scriptlen.%d user.%d p2sh.%d\n",len,msg->scriptlen,msg->userdatalen,msg->p2shlen); |
|
|
//printf("len.%d scriptlen.%d user.%d p2sh.%d\n",len,msg->scriptlen,msg->userdatalen,msg->p2shlen);
|
|
|
if ( rwflag == 0 ) |
|
|
if ( rwflag == 0 ) |
|
|
{ |
|
|
{ |
|
|
msg->vinscript = &serialized[len]; |
|
|
msg->vinscript = &serialized[len]; |
|
@ -93,7 +93,7 @@ int32_t iguana_vinparse(struct iguana_info *coin,int32_t rwflag,uint8_t *seriali |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
printf("sequence starts.%d %08x\n",len,*(int32_t *)&serialized[len]); |
|
|
//printf("sequence starts.%d %08x\n",len,*(int32_t *)&serialized[len]);
|
|
|
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->sequence),&msg->sequence); |
|
|
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->sequence),&msg->sequence); |
|
|
if ( 0 ) |
|
|
if ( 0 ) |
|
|
{ |
|
|
{ |
|
@ -363,7 +363,7 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin |
|
|
serialized[starti] = tmp; |
|
|
serialized[starti] = tmp; |
|
|
for (i=starti+1; i<starti+1+tmp; i++) |
|
|
for (i=starti+1; i<starti+1+tmp; i++) |
|
|
serialized[i] = serialized[i+2]; |
|
|
serialized[i] = serialized[i+2]; |
|
|
printf("tmp.%d (len.%d - starti.%d) i.%d\n",tmp,len,starti,i); |
|
|
//printf("tmp.%d (len.%d - starti.%d) i.%d\n",tmp,len,starti,i);
|
|
|
len -= 2; |
|
|
len -= 2; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@ -374,7 +374,7 @@ int32_t iguana_parsevinobj(struct supernet_info *myinfo,struct iguana_info *coin |
|
|
serialized[starti+1] = (tmp & 0xff); |
|
|
serialized[starti+1] = (tmp & 0xff); |
|
|
serialized[starti+2] = ((tmp >> 8) & 0xff); |
|
|
serialized[starti+2] = ((tmp >> 8) & 0xff); |
|
|
} |
|
|
} |
|
|
printf("len.%d tmp.%d output sequence.[%d] <- %x\n",len,tmp,len,vin->sequence); |
|
|
//printf("len.%d tmp.%d output sequence.[%d] <- %x\n",len,tmp,len,vin->sequence);
|
|
|
len += iguana_rwnum(rwflag,&serialized[len],sizeof(vin->sequence),&vin->sequence); |
|
|
len += iguana_rwnum(rwflag,&serialized[len],sizeof(vin->sequence),&vin->sequence); |
|
|
if ( spendstr != 0 ) |
|
|
if ( spendstr != 0 ) |
|
|
{ |
|
|
{ |
|
@ -577,14 +577,14 @@ int32_t iguana_rwmsgtx(struct iguana_info *coin,int32_t height,int32_t rwflag,cJ |
|
|
} |
|
|
} |
|
|
for (i=0; i<msg->tx_in; i++) |
|
|
for (i=0; i<msg->tx_in; i++) |
|
|
{ |
|
|
{ |
|
|
printf("vin.%d starts offset.%d\n",i,len); |
|
|
//printf("vin.%d starts offset.%d\n",i,len);
|
|
|
if ( vins != 0 && jitem(vins,i) != 0 ) |
|
|
if ( vins != 0 && jitem(vins,i) != 0 ) |
|
|
iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); |
|
|
iguana_vinobjset(&msg->vins[i],jitem(vins,i),spendscript,sizeof(spendscript)); |
|
|
if ( (n= iguana_vinparse(coin,rwflag,&serialized[len],&msg->vins[i])) < 0 ) |
|
|
if ( (n= iguana_vinparse(coin,rwflag,&serialized[len],&msg->vins[i])) < 0 ) |
|
|
return(-1); |
|
|
return(-1); |
|
|
if ( msg->vins[i].spendscript == spendscript ) |
|
|
if ( msg->vins[i].spendscript == spendscript ) |
|
|
msg->vins[i].spendscript = 0; |
|
|
msg->vins[i].spendscript = 0; |
|
|
printf("vin.%d n.%d len.%d\n",i,n,len); |
|
|
//printf("vin.%d n.%d len.%d\n",i,n,len);
|
|
|
len += n; |
|
|
len += n; |
|
|
if ( len > maxsize ) |
|
|
if ( len > maxsize ) |
|
|
{ |
|
|
{ |
|
@ -592,9 +592,6 @@ int32_t iguana_rwmsgtx(struct iguana_info *coin,int32_t height,int32_t rwflag,cJ |
|
|
return(-1); |
|
|
return(-1); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
for (i=0; i<4; i++) |
|
|
|
|
|
printf("%02x",serialized[len+i]); |
|
|
|
|
|
printf(" len.%d\n",len); |
|
|
|
|
|
len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_out); |
|
|
len += iguana_rwvarint32(rwflag,&serialized[len],&msg->tx_out); |
|
|
if ( rwflag == 0 ) |
|
|
if ( rwflag == 0 ) |
|
|
{ |
|
|
{ |
|
|