| 158 | } |
| 159 | |
| 160 | void ScriptPubKeyToUniv(const CScript& scriptPubKey, |
| 161 | UniValue& out, bool fIncludeHex) |
| 162 | { |
| 163 | txnouttype type; |
| 164 | std::vector<CTxDestination> addresses; |
| 165 | int nRequired; |
| 166 | |
| 167 | out.pushKV("asm", ScriptToAsmStr(scriptPubKey)); |
| 168 | if (fIncludeHex) |
| 169 | out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())); |
| 170 | |
| 171 | if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { |
| 172 | out.pushKV("type", GetTxnOutputType(type)); |
| 173 | return; |
| 174 | } |
| 175 | |
| 176 | out.pushKV("reqSigs", nRequired); |
| 177 | out.pushKV("type", GetTxnOutputType(type)); |
| 178 | |
| 179 | UniValue a(UniValue::VARR); |
| 180 | for (const CTxDestination& addr : addresses) { |
| 181 | a.push_back(EncodeDestination(addr)); |
| 182 | } |
| 183 | out.pushKV("addresses", a); |
| 184 | } |
| 185 | |
| 186 | void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex, int serialize_flags) |
| 187 | { |
no test coverage detected