| 11 | #include <version.h> |
| 12 | |
| 13 | CTxOut GetPeginOutputFromWitness(const CScriptWitness& pegin_witness) { |
| 14 | if (pegin_witness.stack.size() < 4) { |
| 15 | return CTxOut(); |
| 16 | } |
| 17 | |
| 18 | CDataStream stream(pegin_witness.stack[0], SER_NETWORK, PROTOCOL_VERSION); |
| 19 | CAmount value; |
| 20 | stream >> value; |
| 21 | |
| 22 | return CTxOut(CAsset(pegin_witness.stack[1]), CConfidentialValue(value), CScript(pegin_witness.stack[3].begin(), pegin_witness.stack[3].end())); |
| 23 | } |
no test coverage detected