OSDN Git Service

add the best utxo select for deposit action.
authorZhiting Lin <zlin035@uottawa.ca>
Fri, 1 Mar 2019 05:40:32 +0000 (13:40 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Fri, 1 Mar 2019 05:40:32 +0000 (13:40 +0800)
src/components/layout/save/action.js

index aa38f8f..536e150 100644 (file)
@@ -4,6 +4,7 @@ import {
   contractArguments
 } from '../../bytom'
 import GetContractArgs from '../../constants'
+import { matchesUTXO } from '../../filter'
 import BigNumber from 'bignumber.js'
 
 export function FixedLimitDeposit(account, amount, address) {
@@ -20,7 +21,7 @@ export function FixedLimitDeposit(account, amount, address) {
         throw 'cannot load UTXO info.'
       }
 
-      const result = resp[0]
+      const result = matchesUTXO(resp, amount)
       const billAmount = result.amount
       const billAsset = result.asset
       const utxo = result.hash