From 94d248033db65464e77c0431bc6ee4d4e2df980e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 6 Jul 2019 07:29:08 -1100 Subject: [PATCH] Key --- src/wallet/rpcwallet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index ef511e78d..a21ca868e 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -180,16 +180,19 @@ UniValue getnewaddress(const UniValue& params, bool fHelp) if ( KOMODO_NSPV != 0 ) { - uint8_t priv32[32]; + UniValue result(UniValue::VOBJ); uint8_t priv32[32]; #ifndef __WIN32 OS_randombytes(priv32,sizeof(priv32)); #else randombytes_buf(priv32,sizeof(priv32)); #endif + CKey key; key.Set(&priv32[0],&priv32[32], true); CPubKey pubkey = key.GetPubKey(); CKeyID vchAddress = pubkey.GetID(); - return(EncodeDestination(vchAddress)); + result.push_back(Pair("address",EncodeDestination(vchAddress))); + result.push_back(Pair("pubkey",HexStr(pubkey))); + return(result); } LOCK2(cs_main, pwalletMain->cs_wallet);