From fd7f88898061cd3f77903af068a55e21aefc9fc3 Mon Sep 17 00:00:00 2001
From: jl777 <jameslee777@yahoo.com>
Date: Wed, 6 Dec 2017 10:46:20 +0400
Subject: [PATCH] Test

---
 iguana/exchanges/LP_transaction.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c
index c563e1ee5..5d33f1ecf 100644
--- a/iguana/exchanges/LP_transaction.c
+++ b/iguana/exchanges/LP_transaction.c
@@ -1333,6 +1333,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson)
         privkeys = cJSON_CreateArray();
         vins = cJSON_CreateArray();
         memset(V,0,sizeof(*V) * maxV);
+        numvins = 0;
         if ( (rawtx= LP_createrawtransaction(&txobj,&numvins,coin,V,maxV,privkey,outputs,vins,privkeys,iter == 0 ? txfee : newtxfee,utxotxid,utxovout,locktime)) != 0 )
         {
             completed = 0;
@@ -1371,7 +1372,18 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson)
     }
     free(V);
     if ( vins != 0 )
+    {
+        if ( (numvins= cJSON_GetArraySize(vins)) > 0 )
+        {
+            
+            for (i=0; i<numvins; i++)
+            {
+                item = jitem(vins,i);
+                LP_availableset(jbits256(item,"txid"),jint(item,"vout"));
+            }
+        }
         free_json(vins);
+    }
     if ( privkeys != 0 )
         free_json(privkeys);
     retjson = cJSON_CreateObject();