merge bitcoin#16725: Don't show addresses or P2PK in decoderawtransaction

This commit is contained in:
Kittywhiskers Van Gogh 2019-08-26 17:32:47 +09:00
parent afad681789
commit 5a69b857e9
2 changed files with 3 additions and 7 deletions

View File

@ -154,7 +154,7 @@ void ScriptToUniv(const CScript& script, UniValue& out, bool include_address)
out.pushKV("type", GetTxnOutputType(type)); out.pushKV("type", GetTxnOutputType(type));
CTxDestination address; CTxDestination address;
if (include_address && ExtractDestination(script, address)) { if (include_address && ExtractDestination(script, address) && type != TX_PUBKEY) {
out.pushKV("address", EncodeDestination(address)); out.pushKV("address", EncodeDestination(address));
} }
} }
@ -170,7 +170,7 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey,
if (fIncludeHex) if (fIncludeHex)
out.pushKV("hex", HexStr(scriptPubKey)); out.pushKV("hex", HexStr(scriptPubKey));
if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired) || type == TX_PUBKEY) {
out.pushKV("type", GetTxnOutputType(type)); out.pushKV("type", GetTxnOutputType(type));
return; return;
} }

View File

@ -14,11 +14,7 @@
"scriptPubKey": { "scriptPubKey": {
"asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG", "asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG",
"hex": "2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac", "hex": "2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac",
"reqSigs": 1, "type": "pubkey"
"type": "pubkey",
"addresses": [
"XqV6rHmzCyFUKF2jSVg8ZkZ7oRhGLVxifK"
]
} }
} }
], ],