jl777 8 years ago
parent
commit
0ce96b07ba
  1. 15
      iguana/iguana_interpreter.c

15
iguana/iguana_interpreter.c

@ -733,6 +733,7 @@ int32_t iguana_checksig(struct iguana_info *coin,struct iguana_stackdata pubkeya
{ {
if ( (retval= (bitcoin_verify(coin->ctx,sig,siglen-1,sigtxid,pubkey,plen) == 0)) == 0 ) if ( (retval= (bitcoin_verify(coin->ctx,sig,siglen-1,sigtxid,pubkey,plen) == 0)) == 0 )
{ {
}
if ( 1 ) if ( 1 )
{ {
int32_t i; char str[65]; int32_t i; char str[65];
@ -741,8 +742,7 @@ int32_t iguana_checksig(struct iguana_info *coin,struct iguana_stackdata pubkeya
printf(" sig, "); printf(" sig, ");
for (i=0; i<plen; i++) for (i=0; i<plen; i++)
printf("%02x",pubkey[i]); printf("%02x",pubkey[i]);
printf(" checksig sigtxid.%s\n",bits256_str(str,sigtxid)); printf(" checksig sigtxid.%s, retval.%d\n",bits256_str(str,sigtxid),retval);
}
} }
return(retval); return(retval);
} }
@ -1158,7 +1158,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
break; break;
} }
HASH_FIND(hh,OPTABLE,str,j,op); HASH_FIND(hh,OPTABLE,str,j,op);
//printf("{%s}\n",str); printf("{%s}\n",str);
str += j; str += j;
if ( op != 0 ) if ( op != 0 )
{ {
@ -1233,7 +1233,7 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
errs++; errs++;
} }
stacks->ifdepth--; stacks->ifdepth--;
//printf("OP_ENDIF status.%d depth.%d\n",stacks->lastpath[stacks->ifdepth],stacks->stackdepth); printf("OP_ENDIF status.%d depth.%d\n",stacks->lastpath[stacks->ifdepth],stacks->stackdepth);
break; break;
case IGUANA_OP_VERIFY: case IGUANA_OP_VERIFY:
break; break;
@ -1250,12 +1250,12 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
{ {
if ( stacks->lastpath[stacks->ifdepth] < 0 ) if ( stacks->lastpath[stacks->ifdepth] < 0 )
{ {
//printf("SKIP opcode.%02x depth.%d\n",op->opcode,stacks->stackdepth); printf("SKIP opcode.%02x depth.%d\n",op->opcode,stacks->stackdepth);
if ( stacks->logarray ) if ( stacks->logarray )
jaddistr(stacks->logarray,"skip"); jaddistr(stacks->logarray,"skip");
continue; continue;
} }
//printf("conditional opcode.%02x stackdepth.%d\n",op->opcode,stacks->stackdepth); printf("conditional opcode.%02x stackdepth.%d\n",op->opcode,stacks->stackdepth);
} }
if ( op->opcode <= IGUANA_OP_16 || ++numops <= MAX_OPS_PER_SCRIPT ) if ( op->opcode <= IGUANA_OP_16 || ++numops <= MAX_OPS_PER_SCRIPT )
{ {
@ -1323,8 +1323,9 @@ int32_t bitcoin_assembler(struct iguana_info *coin,cJSON *logarray,uint8_t scrip
{ {
if ( iguana_cmp(&args[0],&args[1]) == 0 ) if ( iguana_cmp(&args[0],&args[1]) == 0 )
iguana_pushdata(stacks,1,0,0); iguana_pushdata(stacks,1,0,0);
else iguana_pushdata(stacks,0,0,0); else
{ {
iguana_pushdata(stacks,0,0,0);
for (i=0; i<args[0].size; i++) for (i=0; i<args[0].size; i++)
printf("%02x",args[0].U.pubkey[i]); printf("%02x",args[0].U.pubkey[i]);
printf(" <- args[0]\n"); printf(" <- args[0]\n");

Loading…
Cancel
Save