| 244 | } |
| 245 | |
| 246 | bool 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 | |
| 269 | bool PSBTInput::GetUTXO(CTxOut& utxo) const |
| 270 | { |