Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
ccbed76bc0
  1. 4
      iguana/iguana_sign.c

4
iguana/iguana_sign.c

@ -737,7 +737,6 @@ int32_t iguana_msgtx_Vset(struct iguana_info *coin,uint8_t *serialized,int32_t m
} }
msgtx->vins[vini].scriptlen = scriptlen; msgtx->vins[vini].scriptlen = scriptlen;
} }
printf("USERDATALEN.%d scriptlen.%d redeemlen.%d\n",vp->userdatalen,scriptlen,vp->p2shlen);
if ( vp->userdatalen != 0 ) if ( vp->userdatalen != 0 )
{ {
memcpy(&script[scriptlen],vp->userdata,vp->userdatalen); memcpy(&script[scriptlen],vp->userdata,vp->userdatalen);
@ -745,9 +744,9 @@ int32_t iguana_msgtx_Vset(struct iguana_info *coin,uint8_t *serialized,int32_t m
msgtx->vins[vini].userdatalen = vp->userdatalen; msgtx->vins[vini].userdatalen = vp->userdatalen;
scriptlen += vp->userdatalen; scriptlen += vp->userdatalen;
} }
printf("USERDATALEN.%d scriptlen.%d redeemlen.%d\n",vp->userdatalen,scriptlen,vp->p2shlen);
if ( (p2shlen= vp->p2shlen) > 0 ) if ( (p2shlen= vp->p2shlen) > 0 )
{ {
msgtx->vins[vini].redeemscript = &script[scriptlen];
if ( p2shlen < 76 ) if ( p2shlen < 76 )
script[scriptlen++] = p2shlen; script[scriptlen++] = p2shlen;
else if ( p2shlen <= 0xff ) else if ( p2shlen <= 0xff )
@ -761,6 +760,7 @@ int32_t iguana_msgtx_Vset(struct iguana_info *coin,uint8_t *serialized,int32_t m
script[scriptlen++] = (p2shlen & 0xff); script[scriptlen++] = (p2shlen & 0xff);
script[scriptlen++] = ((p2shlen >> 8) & 0xff); script[scriptlen++] = ((p2shlen >> 8) & 0xff);
} else return(-1); } else return(-1);
msgtx->vins[vini].redeemscript = &script[scriptlen];
memcpy(&script[scriptlen],vp->p2shscript,p2shlen); memcpy(&script[scriptlen],vp->p2shscript,p2shlen);
scriptlen += p2shlen; scriptlen += p2shlen;
msgtx->vins[vini].p2shlen = p2shlen; msgtx->vins[vini].p2shlen = p2shlen;

Loading…
Cancel
Save