MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / AddOutput

Method AddOutput

src/psbt.cpp:246–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246bool PartiallySignedTransaction::AddOutput(const PSBTOutput& psbtout)
247{
248 // The output being added must be for this PSBT's version
249 if (psbtout.GetVersion() != GetVersion()) {
250 return false;
251 }
252
253 if (GetVersion() < 2) {
254 // This is a v0 psbt, do the v0 AddOutput
255 outputs.push_back(psbtout);
256 return true;
257 }
258
259 // No global tx, must be PSBTv2
260 // Check outputs are modifiable
261 if (!m_tx_modifiable.has_value() || !m_tx_modifiable->test(1)) {
262 return false;
263 }
264 outputs.push_back(psbtout);
265
266 return true;
267}
268
269bool PSBTInput::GetUTXO(CTxOut& utxo) const
270{

Callers 3

BOOST_AUTO_TEST_CASEFunction · 0.80
FUZZ_TARGETFunction · 0.80
joinpsbtsFunction · 0.80

Calls 4

GetVersionMethod · 0.45
push_backMethod · 0.45
has_valueMethod · 0.45
testMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGETFunction · 0.64