Skip to content

Commit

Permalink
Enable pubkey lookup for p2sh-p2wpkh in validateaddress
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#8992
Rebased-From: 3d2db70
  • Loading branch information
instagibbs authored and luke-jr committed Dec 10, 2016
1 parent 41cced2 commit 4762f19
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/rpcmisc.cpp
Expand Up @@ -137,6 +137,16 @@ class DescribeAddressVisitor : public boost::static_visitor<Object>
int nRequired;
ExtractDestinations(subscript, whichType, addresses, nRequired);
obj.push_back(Pair("script", GetTxnOutputType(whichType)));
if (whichType == TX_WITNESS_V0_KEYHASH) {
int witnessversion;
std::vector<unsigned char> witnessprogram;
subscript.IsWitnessProgram(witnessversion, witnessprogram);
CPubKey vchPubKey;
if (pwalletMain->GetPubKey(CKeyID(uint160(witnessprogram)), vchPubKey)) {
obj.push_back(Pair("pubkey", HexStr(vchPubKey)));
obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed()));
}
}
obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end())));
Array a;
BOOST_FOREACH(const CTxDestination& addr, addresses)
Expand Down

0 comments on commit 4762f19

Please sign in to comment.