| 73 | } |
| 74 | |
| 75 | void ScriptPubKeyToUniv(const CScript& scriptPubKey, |
| 76 | UniValue& out, |
| 77 | bool fIncludeHex) |
| 78 | { |
| 79 | txnouttype type; |
| 80 | vector<CTxDestination> addresses; |
| 81 | int nRequired; |
| 82 | |
| 83 | out.pushKV("asm", scriptPubKey.ToString()); |
| 84 | if (fIncludeHex) |
| 85 | out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())); |
| 86 | |
| 87 | if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { |
| 88 | out.pushKV("type", GetTxnOutputType(type)); |
| 89 | return; |
| 90 | } |
| 91 | |
| 92 | out.pushKV("reqSigs", nRequired); |
| 93 | out.pushKV("type", GetTxnOutputType(type)); |
| 94 | |
| 95 | UniValue a(UniValue::VARR); |
| 96 | for (const CTxDestination& addr : addresses) |
| 97 | a.push_back(EncodeDestination(addr)); |
| 98 | out.pushKV("addresses", a); |
| 99 | } |
| 100 | |
| 101 | void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) |
| 102 | { |
no test coverage detected