MCPcopy Create free account
hub / github.com/dogecoin/dogecoin / ScriptPubKeyToUniv

Function ScriptPubKeyToUniv

src/core_write.cpp:124–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void 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
149void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
150{

Callers 1

TxToUnivFunction · 0.85

Calls 10

ScriptToAsmStrFunction · 0.85
HexStrFunction · 0.85
ExtractDestinationsFunction · 0.85
GetTxnOutputTypeFunction · 0.85
CBitcoinAddressClass · 0.85
pushKVMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected