| 122 | } |
| 123 | |
| 124 | static inline void pushspk(std::vector<valtype>& stack, const CScript& scriptPubKey, const uint256& scriptPubKey_sha) |
| 125 | { |
| 126 | int witnessversion; |
| 127 | valtype witnessprogram; |
| 128 | if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) { |
| 129 | stack.push_back(std::move(witnessprogram)); |
| 130 | stack.push_back(CScriptNum(witnessversion).getvch()); |
| 131 | } else { |
| 132 | stack.emplace_back(scriptPubKey_sha.begin(), scriptPubKey_sha.end()); |
| 133 | stack.push_back(CScriptNum(-1).getvch()); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /** Compute the outpoint flag(u8) for a given txin **/ |
| 138 | template <class T> |
no test coverage detected