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

Function GetPeginOutputFromWitness

src/script/pegins.cpp:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <version.h>
12
13CTxOut 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}

Callers 8

CheckInputScriptsFunction · 0.85
IsWitnessStandardFunction · 0.85
SignPSBTMethod · 0.85
FundTransactionFunction · 0.85
blindrawtransactionFunction · 0.85
SignTransactionFunction · 0.85
rawblindrawtransactionFunction · 0.85
CheckTxInputsMethod · 0.85

Calls 7

CAssetClass · 0.85
CConfidentialValueClass · 0.85
CTxOutClass · 0.70
CScriptClass · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected