omgnetwork / elixir-omg

OMG-Network repository of Watcher and Watcher Info
https://omg.network
Apache License 2.0
213 stars 59 forks source link

feat: transaction.create optimisation #1683

Closed kalouo closed 4 years ago

kalouo commented 4 years ago

Closes #1645

Overview

This PR optimizes utxos from the transaction.create usage by selecting more utxos to inputs if there're rooms available.

Eligibility of utxos to be selected:

Priority to select the utxos are:

Condition to stop selecting utxos:

Changes

Testing

mix test test/omg_watcher_info/utxo_selection_test.exs mix test test/omg_watcher_rpc/web/controllers/transaction_test.exs

kalouo commented 4 years ago

For when you're done with the "code part" ... should probably add a note about this functionality in the Swagger docs.