diff --git a/src/core_write.cpp b/src/core_write.cpp --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -184,7 +184,8 @@ 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, GetConfig())); } } @@ -200,7 +201,8 @@ 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; } diff --git a/test/util/data/txcreateoutpubkey1.json b/test/util/data/txcreateoutpubkey1.json --- a/test/util/data/txcreateoutpubkey1.json +++ b/test/util/data/txcreateoutpubkey1.json @@ -13,11 +13,7 @@ "scriptPubKey": { "asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG", "hex": "2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac", - "reqSigs": 1, - "type": "pubkey", - "addresses": [ - "1FoG2386FG2tAJS9acMuiDsKy67aGg9MKz" - ] + "type": "pubkey" } } ],