Return index to output of txid with value amount Raises exception if there is none.
(node, txid, amount)
| 411 | ############################# |
| 412 | |
| 413 | def find_output(node, txid, amount): |
| 414 | """ |
| 415 | Return index to output of txid with value amount |
| 416 | Raises exception if there is none. |
| 417 | """ |
| 418 | txdata = node.getrawtransaction(txid, 1) |
| 419 | for i in range(len(txdata["vout"])): |
| 420 | if txdata["vout"][i]["value"] == amount: |
| 421 | return i |
| 422 | raise RuntimeError("find_output txid %s : %s not found" % (txid, str(amount))) |
| 423 | |
| 424 | def gather_inputs(from_node, amount_needed, confirmations_required=1): |
| 425 | """ |