MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetSpentScriptsSHA256

Function GetSpentScriptsSHA256

src/script/interpreter.cpp:2490–2497  ·  view source on GitHub ↗

Compute the (single) SHA256 of the concatenation of all scriptPubKeys spent by a tx. */

Source from the content-addressed store, hash-verified

2488
2489/** Compute the (single) SHA256 of the concatenation of all scriptPubKeys spent by a tx. */
2490uint256 GetSpentScriptsSHA256(const std::vector<CTxOut>& outputs_spent)
2491{
2492 CHashWriter ss(SER_GETHASH, 0);
2493 for (const auto& txout : outputs_spent) {
2494 ss << txout.scriptPubKey;
2495 }
2496 return ss.GetSHA256();
2497}
2498
2499/** Compute the vector where each element is SHA256 of scriptPubKeys spent by a tx. */
2500std::vector<uint256> GetSpentScriptPubKeysSHA256(const std::vector<CTxOut>& outputs_spent)

Callers 1

InitMethod · 0.85

Calls 1

GetSHA256Method · 0.80

Tested by

no test coverage detected