Browse Source

Test

etomic
jl777 8 years ago
parent
commit
8b17d32b2e
  1. 20
      iguana/exchanges/LP_bitcoin.c
  2. 2
      iguana/exchanges/LP_transaction.c

20
iguana/exchanges/LP_bitcoin.c

@ -564,12 +564,12 @@ static int32_t iguana_pushdata(struct iguana_interpreter *stacks,int64_t num64,u
//printf("PUSH.(%lld %p %d)\n",(long long)num64,numbuf,numlen); //printf("PUSH.(%lld %p %d)\n",(long long)num64,numbuf,numlen);
if ( stacks->maxstackdepth > 0 ) if ( stacks->maxstackdepth > 0 )
{ {
/*if ( numbuf != 0 ) if ( numbuf != 0 )
{ {
int32_t i; for (i=0; i<numlen; i++) int32_t i; for (i=0; i<numlen; i++)
printf("%02x",numbuf[i]); printf("%02x",numbuf[i]);
} else printf("%lld",(long long)num64); } else printf("%lld",(long long)num64);
printf(" PUSHDATA len.%d\n",numlen);*/ printf(" PUSHDATA len.%d\n",numlen);
if ( stacks->stackdepth < stacks->maxstackdepth ) if ( stacks->stackdepth < stacks->maxstackdepth )
{ {
if ( stacks->logarray != 0 ) if ( stacks->logarray != 0 )
@ -1127,7 +1127,7 @@ int32_t bitcoin_assembler(void *ctx,cJSON *logarray,uint8_t script[IGUANA_MAXSCR
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 )
{ {
@ -1295,14 +1295,14 @@ int32_t bitcoin_assembler(void *ctx,cJSON *logarray,uint8_t script[IGUANA_MAXSCR
else else
{ {
iguana_pushdata(stacks,0,0,0); 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");
for (i=0; i<args[1].size; i++) for (i=0; i<args[1].size; i++)
printf("%02x",args[1].U.pubkey[i]); printf("%02x",args[1].U.pubkey[i]);
printf(" <- args[1]\n"); printf(" <- args[1]\n");
printf("OP_EQUAL.%02x %d vs %d\n",op->opcode,args[0].size,args[1].size); printf("OP_EQUAL.%02x %d vs %d\n",op->opcode,args[0].size,args[1].size);
//} }
} }
else if ( (op->flags & IGUANA_CRYPTOFLAG) != 0 ) else if ( (op->flags & IGUANA_CRYPTOFLAG) != 0 )
{ {
@ -1568,7 +1568,7 @@ int32_t bitcoin_assembler(void *ctx,cJSON *logarray,uint8_t script[IGUANA_MAXSCR
else else
{ {
jadd(interpreter,"result",jfalse()); jadd(interpreter,"result",jfalse());
printf("Evaluate FALSE, depth.%d errs.%d [0] size.%d num.%d\n",stacks->stackdepth,errs,stacks->stack[0].size,stacks->stack[0].U.val); printf("Evaluate FALSE, depth.%d errs.%d [0] size.%d val.%d\n",stacks->stackdepth,errs,stacks->stack[0].size,stacks->stack[0].U.val);
errs++; errs++;
if ( stacks->logarray != 0 ) if ( stacks->logarray != 0 )
printf("LOG.(%s)\n\n",jprint(stacks->logarray,0)); printf("LOG.(%s)\n\n",jprint(stacks->logarray,0));

2
iguana/exchanges/LP_transaction.c

@ -571,7 +571,7 @@ int32_t iguana_signrawtransaction(void *ctx,char *symbol,uint8_t pubtype,uint8_t
if ( (complete= bitcoin_verifyvins(ctx,symbol,pubtype,p2shtype,isPoS,height,signedtxidp,&signedtx,msgtx,serialized3,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys)) > 0 && signedtx != 0 ) if ( (complete= bitcoin_verifyvins(ctx,symbol,pubtype,p2shtype,isPoS,height,signedtxidp,&signedtx,msgtx,serialized3,maxsize,V,SIGHASH_ALL,1,V->suppress_pubkeys)) > 0 && signedtx != 0 )
{ {
int32_t tmp; //char str[65]; int32_t tmp; //char str[65];
if ( (tmp= iguana_interpreter(ctx,0,iguana_lockval(finalized,jint(txobj,"locktime")),V,numinputs)) < 0 ) if ( (tmp= iguana_interpreter(ctx,cJSON_CreateArray(),iguana_lockval(finalized,jint(txobj,"locktime")),V,numinputs)) < 0 )
{ {
printf("iguana_interpreter %d error.(%s)\n",tmp,signedtx); printf("iguana_interpreter %d error.(%s)\n",tmp,signedtx);
complete = 0; complete = 0;

Loading…
Cancel
Save