@ -15,7 +15,6 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# include "dragon.h"
# include "exchanges/bitcoin.h"
int32_t bitcoin_pubkeyspend ( uint8_t * script , int32_t n , uint8_t pubkey [ 66 ] )
{
@ -1054,35 +1053,5 @@ uint8_t *dragon_ramchain_scriptdecode(int32_t *metalenp,int32_t *scriptlenp,uint
return ( & Kspace [ uoffset ] ) ;
} else return ( 0 ) ;
}
/*origoffset = ramchain->H.scriptoffset;
if ( type ! = DRAGON_SCRIPT_STRANGE & & type ! = DRAGON_SCRIPT_DATA & & type ! = DRAGON_SCRIPT_OPRETURN & & scriptlen > 0 & & script ! = 0 )
{
if ( Kspace ! = 0 & & ramchain - > H . scriptoffset + scriptlen + 3 < = rdata - > scriptspace - ramchain - > H . stacksize )
{
if ( ( u - > scriptoffset = dragon_ramchain_scriptencode ( coin , Kspace , & ramchain - > H . scriptoffset , type , script , scriptlen , & pubkeyoffset ) ) > 0 | | type = = DRAGON_SCRIPT_76AC )
{
fprintf ( stderr , " new offset.%d from scriptlen.%d pubkeyoffset.%d \n " , ramchain - > H . scriptoffset , scriptlen , pubkeyoffset ) ;
}
//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 , rdata - > scriptspace , ramchain - > H . stacksize ) ;
checkscript = dragon_ramchain_scriptdecode ( & metalen , & checklen , Kspace , u - > type , _script , u - > scriptoffset , P [ pkind ] . pubkeyoffset < ramchain - > H . scriptoffset ? P [ pkind ] . pubkeyoffset : 0 ) ;
if ( checklen ! = scriptlen | | ( script ! = 0 & & checkscript ! = 0 & & memcmp ( checkscript , script , scriptlen ) ! = 0 ) )
{
//printf("create script mismatch len.%d vs %d or cmp error.%d\n",scriptlen,checklen,(script!=0&&checkscript!=0)?memcmp(checkscript,script,scriptlen):0);
type = DRAGON_SCRIPT_STRANGE ;
} //else printf("RO spendscript match.%d\n",scriptlen);
}
if ( type = = DRAGON_SCRIPT_DATA | | type = = DRAGON_SCRIPT_OPRETURN | | type = = DRAGON_SCRIPT_STRANGE )
{
if ( script ! = 0 & & scriptlen > 0 )
{
u - > scriptoffset = origoffset ;
origoffset + = dragon_rwvarint32 ( 1 , & Kspace [ origoffset ] , ( void * ) & scriptlen ) ;
memcpy ( & Kspace [ origoffset ] , script , scriptlen ) ;
ramchain - > H . scriptoffset = origoffset + scriptlen ;
}
}
else if ( type = = DRAGON_SCRIPT_76AC & & pubkeyoffset ! = 0 & & P [ pkind ] . pubkeyoffset = = 0 )
P [ pkind ] . pubkeyoffset = pubkeyoffset ; */
# endif