Browse Source

importaddress

etomic
jl777 8 years ago
parent
commit
e09d416214
  1. 6
      iguana/iguana_rpc.c
  2. 13
      iguana/iguana_wallet.c
  3. 1
      includes/iguana_apideclares.h

6
iguana/iguana_rpc.c

@ -398,6 +398,11 @@ static char *dumpprivkey(RPCARGS)
return(sglue1(0,CALLGLUE,"bitcoinrpc","dumpprivkey","address",params[0]));
}
static char *importaddress(RPCARGS)
{
return(sglue3(0,CALLGLUE,"bitcoinrpc","importaddress","address",params[0],"account",params[1],"rescan",params[2]));
}
static char *importprivkey(RPCARGS)
{
return(sglue3(0,CALLGLUE,"bitcoinrpc","importprivkey","wif",params[0],"account",params[1],"rescan",params[2]));
@ -612,6 +617,7 @@ struct RPC_info { char *name; char *(*rpcfunc)(RPCARGS); int32_t flag0,remotefla
{ "dumpwallet", &dumpwallet, true, false },
{ "importwallet", &importwallet, false, false },
{ "importprivkey", &importprivkey, false, false },
{ "importaddress", &importaddress, false, false },
{ "getrawtransaction", &getrawtransaction, false, false },
{ "createrawtransaction", &createrawtransaction, false, false },
{ "validaterawtransaction", &validaterawtransaction, false, true },

13
iguana/iguana_wallet.c

@ -1464,6 +1464,19 @@ FOUR_STRINGS(bitcoinrpc,walletpassphrasechange,oldpassword,newpassword,oldperman
return(retstr);
}
TWOSTRINGS_AND_INT(bitcoinrpc,importaddress,address,account,rescan)
{
if ( remoteaddr != 0 )
return(clonestr("{\"error\":\"no remote\"}"));
if ( coin != 0 && coin->notarychain >= 0 && coin->FULLNODE == 0 && address != 0 && account != 0 )
{
if ( strcmp(address,account) != 0 )
return(clonestr("{\"error\":\"only special account == address supported\"}"));
else return(_dex_importaddress(myinfo,coin->symbol,address));
}
return(0);
}
TWOSTRINGS_AND_INT(bitcoinrpc,importprivkey,wif,account,rescan)
{
bits256 privkey; char *retstr,*str; cJSON *retjson; struct iguana_waddress addr,*waddr; struct iguana_waccount *wacct = 0; uint8_t type,redeemScript[4096]; int32_t len; struct vin_info V; bits256 debugtxid;

1
includes/iguana_apideclares.h

@ -124,6 +124,7 @@ STRING_ARG(bitcoinrpc,backupwallet,filename);
STRING_ARG(bitcoinrpc,importwallet,filename);
STRING_ARG(bitcoinrpc,getnewaddress,account);
TWOSTRINGS_AND_INT(bitcoinrpc,importprivkey,wif,account,rescan);
TWOSTRINGS_AND_INT(bitcoinrpc,importaddress,address,account,rescan);
STRING_ARG(bitcoinrpc,dumpprivkey,address);
STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatchonly);

Loading…
Cancel
Save