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

Method AddOutput

src/psbt.cpp:293–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293bool PartiallySignedTransaction::AddOutput(const PSBTOutput& psbtout)
294{
295 if (psbtout.amount == std::nullopt || psbtout.script == std::nullopt) {
296 return false;
297 }
298
299 if (tx != std::nullopt) {
300 // This is a v0 psbt, do the v0 AddOutput
301 CTxOut txout(CAsset(), *psbtout.amount, *psbtout.script);
302 tx->vout.push_back(txout);
303 outputs.push_back(psbtout);
304 return true;
305 }
306
307 // No global tx, must be PSBTv2
308 // Check outputs are modifiable
309 if (m_tx_modifiable == std::nullopt || !m_tx_modifiable->test(1)) {
310 return false;
311 }
312 outputs.push_back(psbtout);
313
314 return true;
315}
316
317bool PSBTInput::GetUTXO(CTxOut& utxo) const
318{

Callers 2

FUZZ_TARGET_INITFunction · 0.80
joinpsbtsFunction · 0.80

Calls 3

CAssetClass · 0.85
push_backMethod · 0.45
testMethod · 0.45

Tested by 1

FUZZ_TARGET_INITFunction · 0.64