Skip to content

Commit

Permalink
Merge 335b34c into merged_master (Bitcoin PR #16725)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Nov 9, 2020
2 parents 8fa52e8 + 335b34c commit 3d7ed20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void ScriptToUniv(const CScript& script, UniValue& out, bool include_address)
out.pushKV("type", GetTxnOutputType(type));

CTxDestination address;
if (include_address && ExtractDestination(script, address)) {
if (include_address && ExtractDestination(script, address) && type != TX_PUBKEY) {
out.pushKV("address", EncodeDestination(address));
}
}
Expand All @@ -189,7 +189,7 @@ static void SidechainScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& o
if (fIncludeHex)
out.pushKV(prefix + "hex", HexStr(scriptPubKey.begin(), scriptPubKey.end()));

if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) {
if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired) || type == TX_PUBKEY) {
out.pushKV(prefix + "type", GetTxnOutputType(type));
return;
}
Expand Down
6 changes: 1 addition & 5 deletions test/util/data/txcreateoutpubkey1.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
"scriptPubKey": {
"asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG",
"hex": "2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac",
"reqSigs": 1,
"type": "pubkey",
"addresses": [
"1FoG2386FG2tAJS9acMuiDsKy67aGg9MKz"
]
"type": "pubkey"
}
}
],
Expand Down

0 comments on commit 3d7ed20

Please sign in to comment.