Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
1b3658f724
  1. 9
      iguana/iguana_ramchain.c
  2. 2
      iguana/iguana_recv.c

9
iguana/iguana_ramchain.c

@ -477,7 +477,7 @@ uint32_t iguana_ramchain_scriptencode(struct iguana_info *coin,uint8_t *Kspace,u
printf(" script arg\n");
for (i=0; i<plen; i++)
printf("%02x",Kspace[pubkeyoffset+i]);
printf(" Kspace[%d] len.%d pubkeyoffset.%d\n",pubkeyoffset,offset,pubkeyoffset);
printf(" Kspace[%d] len.%d pubkeyoffset.%d\n",offset,plen,pubkeyoffset);
printf("iguana_ramchain_scriptencode: mismatched pubkey?\n");
//getchar();
}
@ -870,7 +870,9 @@ uint32_t iguana_ramchain_addunspent(struct iguana_info *coin,RAMCHAIN_FUNC,uint6
//fprintf(stderr,"new offset.%d from scriptlen.%d pubkeyoffset.%d\n",ramchain->H.scriptoffset,scriptlen,pubkeyoffset);
if ( type == IGUANA_SCRIPT_76AC && pubkeyoffset != 0 )
{
if ( P[pkind].pubkeyoffset == 0 )
P[pkind].pubkeyoffset = pubkeyoffset;
else printf("mismatched P[%d].pubkeyoffset %d vs %d\n",pkind,P[pkind].pubkeyoffset,pubkeyoffset);
//int32_t i; for (i=0; i<33; i++)
// printf("%02x",Kspace[P[pkind].pubkeyoffset+i]);
//printf(" set pubkey.[%d] <- scriptoffset.%d\n",pkind,P[pkind].pubkeyoffset);
@ -878,6 +880,11 @@ uint32_t iguana_ramchain_addunspent(struct iguana_info *coin,RAMCHAIN_FUNC,uint6
}
//printf("[%d] u%d offset.%u len.%d\n",hdrsi,unspentind,u->scriptoffset,scriptlen);
} else printf("[%d] u%d Kspace.%p scriptspace overflow! %d + %d vs space.%d - stack.%d\n",hdrsi,unspentind,Kspace,ramchain->H.scriptoffset,scriptlen,ramchain->H.data->scriptspace,ramchain->H.stacksize);
checkscript = iguana_ramchain_scriptdecode(&metalen,&checklen,Kspace,u->type,_script,u->scriptoffset,P[pkind].pubkeyoffset < ramchain->H.scriptoffset ? P[pkind].pubkeyoffset : 0);
if ( checklen != scriptlen || (scriptlen > 0 && memcmp(checkscript,script,scriptlen) != 0) )
{
printf("create script mismatch len.%d vs %d or cmp error.%d\n",scriptlen,checklen,script!=0?memcmp(checkscript,script,scriptlen):0);
} //else printf("RO spendscript match.%d\n",scriptlen);
}
}
//printf("%p A[%d] last <- U%d\n",&A[pkind],pkind,unspentind);

2
iguana/iguana_recv.c

@ -628,6 +628,8 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
vcalc_sha256(0,allhash.bytes,blockhashes[0].bytes,coin->chain->bundlesize * sizeof(*blockhashes));
if ( bits256_cmp(allhash,bp->allhash) == 0 )
{
if ( bp->queued != 0 )
bp->queued = 0;
if ( iguana_allhashcmp(coin,bp,blockhashes,coin->chain->bundlesize) > 0 )
{
bp->hdrtime = (uint32_t)time(NULL);

Loading…
Cancel
Save