From c5e7f2d9e6346c29b46637761f651f7071024614 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 8 Mar 2016 23:05:50 -0300 Subject: [PATCH] test --- iguana/iguana_ramchain.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 30533eb19..96256e197 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -687,7 +687,7 @@ int32_t iguana_vinscriptencode(struct iguana_info *coin,uint8_t *Kstackend,uint3 return(0); } memcpy(&Kspace[diff - stacksize],sigsbuf,sigslen); - //printf("Kspace.%p Kstackend.%p diff.%ld stacksize.%d sigsbuf.%p sigslen.%d [%02x]\n",Kspace,Kstackend,diff,stacksize,sigsbuf,sigslen,Kspace[diff - stacksize + sigslen - 1]); + printf("Kspace.%p Kstackend.%p diff.%ld stacksize.%d sigsbuf.%p sigslen.%d [%02x]\n",Kspace,Kstackend,diff,stacksize,sigsbuf,sigslen,Kspace[diff - stacksize + sigslen - 1]); for (i=0; isigsfileptr != 0 && stacksize < ramchain->sigsfilesize ) + if ( stacksize < diff ) { - memcpy(&_script[scriptlen],(void *)((long)ramchain->sigsfileptr + diff - stacksize),sigslen); + if ( ramchain->sigsfileptr != 0 && stacksize < ramchain->sigsfilesize ) + memcpy(&_script[scriptlen],(void *)((long)ramchain->sigsfileptr + diff - stacksize),sigslen); + else memcpy(&_script[scriptlen],&Kspace[diff - stacksize],sigslen); + printf("emit.%p from.%ld sigslen.%d [%02x] stacksize.%d\n",&Kspace[diff - stacksize],diff - stacksize,sigslen,Kspace[diff - stacksize + sigslen - 1],stacksize); } scriptlen += sigslen; - //printf("emit.%p from.%ld sigslen.%d [%02x] stacksize.%d\n",&Kspace[diff - stacksize],diff - stacksize,sigslen,Kspace[diff - stacksize + sigslen - 1],stacksize); } if ( s->numpubkeys > 0 ) {