| 177 | } |
| 178 | |
| 179 | void ScriptToUniv(const CScript &script, UniValue &out, bool include_address) { |
| 180 | out.pushKV("asm", ScriptToAsmStr(script)); |
| 181 | out.pushKV("hex", HexStr(script)); |
| 182 | |
| 183 | std::vector<std::vector<uint8_t>> solns; |
| 184 | TxoutType type = Solver(script, solns); |
| 185 | out.pushKV("type", GetTxnOutputType(type)); |
| 186 | |
| 187 | CTxDestination address; |
| 188 | if (include_address && ExtractDestination(script, address) && |
| 189 | type != TxoutType::PUBKEY) { |
| 190 | out.pushKV("address", EncodeDestination(address, GetConfig())); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, |
| 195 | bool fIncludeHex) { |