MCPcopy Create free account
hub / github.com/LUX-Core/lux / ScriptPubKeyToUniv

Function ScriptPubKeyToUniv

src/core_write.cpp:75–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void 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
101void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
102{

Callers 1

TxToUnivFunction · 0.85

Calls 9

HexStrFunction · 0.85
ExtractDestinationsFunction · 0.85
GetTxnOutputTypeFunction · 0.85
EncodeDestinationFunction · 0.85
pushKVMethod · 0.45
ToStringMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected