| 315 | } |
| 316 | |
| 317 | bool PSBTInput::GetUTXO(CTxOut& utxo) const |
| 318 | { |
| 319 | if (non_witness_utxo) { |
| 320 | if (*prev_out >= non_witness_utxo->vout.size()) { |
| 321 | return false; |
| 322 | } |
| 323 | utxo = non_witness_utxo->vout[*prev_out]; |
| 324 | } else if (!witness_utxo.IsNull()) { |
| 325 | utxo = witness_utxo; |
| 326 | } else if (m_peg_in_value && !m_peg_in_claim_script.empty()) { |
| 327 | // For Peg-ins, get the UTXO from the peg-in stuff |
| 328 | utxo = CTxOut(Params().GetConsensus().pegged_asset, CConfidentialValue(*m_peg_in_value), m_peg_in_claim_script); |
| 329 | } else { |
| 330 | return false; |
| 331 | } |
| 332 | return true; |
| 333 | } |
| 334 | |
| 335 | COutPoint PSBTInput::GetOutPoint() const |
| 336 | { |