| 2513 | /** Compute the vector where each element is SHA256 of output scriptPubKey of a tx. */ |
| 2514 | template <class T> |
| 2515 | std::vector<uint256> GetOutputScriptPubKeysSHA256(const T& txTo) |
| 2516 | { |
| 2517 | std::vector<uint256> out_spk_single_hashes; |
| 2518 | out_spk_single_hashes.reserve(txTo.vout.size()); |
| 2519 | for (const auto& txout : txTo.vout) { |
| 2520 | // Normal serialization using the << operator would also serialize the length, therefore we directly write using CSHA256 |
| 2521 | uint256 out_spk_single_hash; |
| 2522 | CSHA256().Write(txout.scriptPubKey.data(), txout.scriptPubKey.size()).Finalize(out_spk_single_hash.data()); |
| 2523 | out_spk_single_hashes.push_back(std::move(out_spk_single_hash)); |
| 2524 | } |
| 2525 | return out_spk_single_hashes; |
| 2526 | } |
| 2527 | |
| 2528 | template <class T> |
| 2529 | uint256 GetRangeproofsHash(const T& txTo) { |