| 416 | } |
| 417 | |
| 418 | bool psbt_has_input(const struct wally_psbt *psbt, |
| 419 | const struct bitcoin_outpoint *outpoint) |
| 420 | { |
| 421 | for (size_t i = 0; i < psbt->num_inputs; i++) { |
| 422 | struct bitcoin_txid in_txid; |
| 423 | struct wally_tx_input *in = &psbt->tx->inputs[i]; |
| 424 | |
| 425 | if (outpoint->n != in->index) |
| 426 | continue; |
| 427 | |
| 428 | wally_tx_input_get_txid(in, &in_txid); |
| 429 | if (bitcoin_txid_eq(&outpoint->txid, &in_txid)) |
| 430 | return true; |
| 431 | } |
| 432 | return false; |
| 433 | } |
| 434 | |
| 435 | struct amount_sat psbt_input_get_amount(const struct wally_psbt *psbt, |
| 436 | size_t in) |
no test coverage detected