| 138 | } |
| 139 | |
| 140 | void ScriptPubKeyToUniv(const CScript& scriptPubKey, |
| 141 | UniValue& out, bool fIncludeHex) |
| 142 | { |
| 143 | txnouttype type; |
| 144 | vector<CTxDestination> addresses; |
| 145 | int nRequired; |
| 146 | |
| 147 | out.pushKV("asm", ScriptToAsmStr(scriptPubKey)); |
| 148 | if (fIncludeHex) |
| 149 | out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())); |
| 150 | |
| 151 | if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { |
| 152 | out.pushKV("type", GetTxnOutputType(type)); |
| 153 | return; |
| 154 | } |
| 155 | |
| 156 | out.pushKV("reqSigs", nRequired); |
| 157 | out.pushKV("type", GetTxnOutputType(type)); |
| 158 | |
| 159 | UniValue a(UniValue::VARR); |
| 160 | BOOST_FOREACH(const CTxDestination& addr, addresses) |
| 161 | a.push_back(CBitcoinAddress(addr).ToString()); |
| 162 | out.pushKV("addresses", a); |
| 163 | } |
| 164 | |
| 165 | void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) |
| 166 | { |
no test coverage detected