diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 5589b5d23b..39a1744e02 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -319,12 +319,12 @@ UniValue validateaddress(const JSONRPCRequest& request) } if (meta) { ret.push_back(Pair("timestamp", meta->nCreateTime)); - CHDChain hdChainCurrent; - if (pwallet->mapHdPubKeys.count(*keyID) && pwallet->GetHDChain(hdChainCurrent)) { - ret.push_back(Pair("hdkeypath", pwallet->mapHdPubKeys[*keyID].GetKeyPath())); - ret.push_back(Pair("hdchainid", hdChainCurrent.GetID().GetHex())); - } + } + CHDChain hdChainCurrent; + if (pwallet->mapHdPubKeys.count(*keyID) && pwallet->GetHDChain(hdChainCurrent)) { + ret.push_back(Pair("hdkeypath", pwallet->mapHdPubKeys[*keyID].GetKeyPath())); + ret.push_back(Pair("hdchainid", hdChainCurrent.GetID().GetHex())); } } #endif