| 122 | } |
| 123 | |
| 124 | void ScriptPubKeyToUniv(const CScript& scriptPubKey, |
| 125 | UniValue& out, bool fIncludeHex) |
| 126 | { |
| 127 | txnouttype type; |
| 128 | std::vector<CTxDestination> addresses; |
| 129 | int nRequired; |
| 130 | |
| 131 | out.pushKV("asm", ScriptToAsmStr(scriptPubKey)); |
| 132 | if (fIncludeHex) |
| 133 | out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())); |
| 134 | |
| 135 | if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { |
| 136 | out.pushKV("type", GetTxnOutputType(type)); |
| 137 | return; |
| 138 | } |
| 139 | |
| 140 | out.pushKV("reqSigs", nRequired); |
| 141 | out.pushKV("type", GetTxnOutputType(type)); |
| 142 | |
| 143 | UniValue a(UniValue::VARR); |
| 144 | BOOST_FOREACH(const CTxDestination& addr, addresses) |
| 145 | a.push_back(CBitcoinAddress(addr).ToString()); |
| 146 | out.pushKV("addresses", a); |
| 147 | } |
| 148 | |
| 149 | void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) |
| 150 | { |
no test coverage detected