diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index 89ace68eb..4f611ba80 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -368,7 +368,7 @@ static char *dumpprivkey(RPCARGS) static char *importprivkey(RPCARGS) { - return(sglue1(0,CALLGLUE,"bitcoinrpc","importprivkey","wif",params[0])); + return(sglue3(0,CALLGLUE,"bitcoinrpc","importprivkey","wif",params[0],"account",params[1],"rescan",params[2])); } static char *dumpwallet(RPCARGS) diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index ff5e82556..210e85f0c 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1157,8 +1157,8 @@ TWOSTRINGS_AND_INT(bitcoinrpc,importprivkey,wif,account,rescan) if ( waddr == 0 ) waddr = &addr; iguana_waddresscalc(myinfo,coin->chain->pubtype,coin->chain->wiftype,waddr,privkey); - retjson = iguana_walletadd(myinfo,0,coin,retstr,account,waddr,0,0); iguana_waccountswitch(myinfo,coin,account,waddr->coinaddr,0); + retjson = iguana_walletadd(myinfo,0,coin,retstr,account,waddr,0,0); if ( retstr != 0 ) scrubfree(retstr); return(jprint(retjson,1)); diff --git a/iguana/tests/importprivkey b/iguana/tests/importprivkey index eaffafce9..26a53c9df 100755 --- a/iguana/tests/importprivkey +++ b/iguana/tests/importprivkey @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"UvBSu7PtUcGFeCd4fJdWSN6NKH4DPzmMoZtPn4Sb94Tj3CyXj9Fn\"]}" +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"UvBSu7PtUcGFeCd4fJdWSN6NKH4DPzmMoZtPn4Sb94Tj3CyXj9Fn\", \"testing\"]}"