Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
91b0d8db0c
  1. 4
      iguana/iguana_ramchain.c
  2. 14
      iguana/iguana_scripts.c
  3. 2
      iguana/iguana_tx.c

4
iguana/iguana_ramchain.c

@ -265,7 +265,7 @@ uint32_t iguana_ramchain_addunspent20(struct iguana_info *coin,struct iguana_pee
if ( type < 0 )
{
type = iguana_calcrmd160(coin,&V,script,scriptlen,txid,vout,0xffffffff);
if ( type == 1 && bitcoin_pubkeylen(script+1) <= 0 )
if ( (type == 12 && scriptlen == 0) || (type == 1 && bitcoin_pubkeylen(script+1) <= 0) )
{
int32_t i; for (i=0; i<scriptlen; i++)
printf("%02x",script[i]);
@ -330,6 +330,8 @@ uint32_t iguana_ramchain_addunspent20(struct iguana_info *coin,struct iguana_pee
}
else
{
if ( type == 12 )
printf("unexpected regen?? type.%d scriptlen.%d\n",u->type,scriptlen);
u->scriptpos = 0;
u->fileid = 0;
}

14
iguana/iguana_scripts.c

@ -302,10 +302,10 @@ const char *get_opname(int32_t *extralenp,enum opcodetype opcode)
int32_t bitcoin_pubkeyspend(uint8_t *script,int32_t n,uint8_t pubkey[66])
{
int32_t scriptlen = bitcoin_pubkeylen(pubkey);
script[n++] = scriptlen;
memcpy(&script[n],pubkey,scriptlen);
n += scriptlen;
int32_t plen = bitcoin_pubkeylen(pubkey);
script[n++] = plen;
memcpy(&script[n],pubkey,plen);
n += plen;
script[n++] = SCRIPT_OP_CHECKSIG;
return(n);
}
@ -481,8 +481,10 @@ int32_t iguana_scriptgen(struct iguana_info *coin,int32_t *Mp,int32_t *nump,char
strcpy(asmstr,"OP_DUP ");
sprintf(asmstr + strlen(asmstr),"%s OP_CHECKSIG // %s",pubkeystr,coinaddr);
}
scriptlen = bitcoin_pubkeyspend(script,0,(uint8_t *)vp->signers[0].pubkey);
//printf("[%02x] scriptlen.%d (%s)\n",vp->signers[0].pubkey[0],scriptlen,asmstr);
if ( type == IGUANA_SCRIPT_76AC )
script[scriptlen++] = 0x76;
scriptlen = bitcoin_pubkeyspend(script,scriptlen,(uint8_t *)vp->signers[0].pubkey);
//printf("[%02x] type.%d scriptlen.%d\n",vp->signers[0].pubkey[0],type,scriptlen);
break;
case IGUANA_SCRIPT_76A988AC:
if ( asmstr != 0 )

2
iguana/iguana_tx.c

@ -93,7 +93,7 @@ int32_t iguana_voutset(struct iguana_info *coin,uint8_t *scriptspace,char *asmst
{
memset(&V,0,sizeof(V));
scriptlen = iguana_scriptgen(coin,&V.M,&V.N,coinaddr,scriptspace,asmstr,p->rmd160,u->type,(const struct vin_info *)&V,i);
printf("scriptlen.%d type.%d\n",scriptlen,u->type);
// printf("scriptlen.%d type.%d\n",scriptlen,u->type);
}
} else printf("iguana_voutset unexpected path\n");
vout->pk_scriptlen = scriptlen;

Loading…
Cancel
Save