Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6e4daff01a
  1. 2
      iguana/iguana_payments.c
  2. 8
      iguana/iguana_wallet.c

2
iguana/iguana_payments.c

@ -238,7 +238,7 @@ STRING_ARG(bitcoinrpc,validatepubkey,pubkeystr)
STRING_ARG(bitcoinrpc,decodescript,scriptstr)
{
int32_t scriptlen; uint8_t script[IGUANA_MAXSCRIPTSIZE],rmd160[20]; char coinaddr[128],asmstr[IGUANA_MAXSCRIPTSIZE*2+1]; cJSON *scriptobj,*retjson = cJSON_CreateObject();
if ( coin != 0 && (scriptlen= (int32_t)strlen(scriptstr)>>1) < sizeof(script) )
if ( scriptstr != 0 && coin != 0 && (scriptlen= (int32_t)strlen(scriptstr)>>1) < sizeof(script) )
{
decode_hex(script,scriptlen,scriptstr);
if ( (scriptobj= iguana_scriptobj(coin,rmd160,coinaddr,asmstr,script,scriptlen)) != 0 )

8
iguana/iguana_wallet.c

@ -827,8 +827,12 @@ STRING_ARG(bitcoinrpc,validateaddress,address)
retjson = cJSON_CreateObject();
jaddstr(retjson,"result","success");
jaddnum(retjson,"addrtype",addrtype);
init_hexbytes_noT(str,rmd160,sizeof(rmd160));
jaddstr(retjson,"rmd160",str);
init_hexbytes_noT(str+6,rmd160,sizeof(rmd160));
jaddstr(retjson,"rmd160",str+6);
memcpy(str,"76a914",6);
strcat(str,"88ac");
jaddstr(retjson,"scriptPubKey",str);
jadd(retjson,"isscript",(addrtype == coin->chain->p2shtype) ? jtrue() : jfalse());
if ( iguana_ismine(myinfo,coin,addrtype,pubkey,rmd160) > 0 )
{
init_hexbytes_noT(str,pubkey,bitcoin_pubkeylen(pubkey));

Loading…
Cancel
Save