| 578 | } |
| 579 | |
| 580 | bool psbt_has_input(const struct wally_psbt *psbt, |
| 581 | const struct bitcoin_outpoint *outpoint) |
| 582 | { |
| 583 | for (size_t i = 0; i < psbt->num_inputs; i++) { |
| 584 | struct bitcoin_txid in_txid; |
| 585 | const struct wally_psbt_input *in = &psbt->inputs[i]; |
| 586 | |
| 587 | if (outpoint->n != in->index) |
| 588 | continue; |
| 589 | |
| 590 | wally_psbt_input_get_txid(in, &in_txid); |
| 591 | if (bitcoin_txid_eq(&outpoint->txid, &in_txid)) |
| 592 | return true; |
| 593 | } |
| 594 | return false; |
| 595 | } |
| 596 | |
| 597 | struct amount_sat psbt_input_get_amount(const struct wally_psbt *psbt, |
| 598 | size_t in) |
no test coverage detected