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

Function GetSpentAssetsAmountsSHA256

src/script/interpreter.cpp:2479–2487  ·  view source on GitHub ↗

Compute the (single) SHA256 of the concatenation of all asset and amounts commitments spent by a tx. */ Elements TapHash only

Source from the content-addressed store, hash-verified

2477/** Compute the (single) SHA256 of the concatenation of all asset and amounts commitments spent by a tx. */
2478// Elements TapHash only
2479uint256 GetSpentAssetsAmountsSHA256(const std::vector<CTxOut>& outputs_spent)
2480{
2481 CHashWriter ss(SER_GETHASH, 0);
2482 for (const auto& txout : outputs_spent) {
2483 ss << txout.nAsset;
2484 ss << txout.nValue;
2485 }
2486 return ss.GetSHA256();
2487}
2488
2489/** Compute the (single) SHA256 of the concatenation of all scriptPubKeys spent by a tx. */
2490uint256 GetSpentScriptsSHA256(const std::vector<CTxOut>& outputs_spent)

Callers 1

InitMethod · 0.85

Calls 1

GetSHA256Method · 0.80

Tested by

no test coverage detected