aboutsummaryrefslogtreecommitdiff
path: root/src/core_write.cpp
diff options
context:
space:
mode:
authornicolas.dorier <nicolas.dorier@gmail.com>2019-08-26 17:32:47 +0900
committernicolas.dorier <nicolas.dorier@gmail.com>2019-08-30 11:29:21 +0900
commit6d803494b59ab5520079b6a72d97790d86d2a015 (patch)
treeadb73af19ab2411f9b29f7cca69f01fbe5e8b7b0 /src/core_write.cpp
parente00ecb3d7aaee463643e486ca03c318e192b8058 (diff)
Don't show addresses or P2PK in decoderawtransaction
Diffstat (limited to 'src/core_write.cpp')
-rw-r--r--src/core_write.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core_write.cpp b/src/core_write.cpp
index 4d64446d7b..7ce2a49836 100644
--- a/src/core_write.cpp
+++ b/src/core_write.cpp
@@ -144,7 +144,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));
}
}
@@ -160,7 +160,7 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey,
if (fIncludeHex)
out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end()));
- if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) {
+ if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired) || type == TX_PUBKEY) {
out.pushKV("type", GetTxnOutputType(type));
return;
}