| 806 | } |
| 807 | |
| 808 | bool wally_tx_input_spends(const struct wally_tx_input *input, |
| 809 | const struct bitcoin_outpoint *outpoint) |
| 810 | { |
| 811 | /* Useful, as tx_part can have some NULL inputs */ |
| 812 | if (!input) |
| 813 | return false; |
| 814 | if (!CROSS_TYPE_EQ(&outpoint->txid, &input->txhash)) |
| 815 | return false; |
| 816 | return input->index == outpoint->n; |
| 817 | } |
| 818 | |
| 819 | /* FIXME(cdecker) Make the caller pass in a reference to amount_asset, and |
| 820 | * return false if unintelligible/encrypted. (WARN UNUSED). */ |