From bf837b072785c52ccaedec3fd09cb1d10b0132eb Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Fri, 7 Dec 2018 11:46:09 +0100
Subject: [PATCH] [fix] #151, #83: tx: intermediaries tx sent to the wrong
 recipient.

- Change recipient for intermediaries tx to the issuer pubkey.
- Handle loop for multi and single recipients tx according to the type of the
recipient.
---
 silkaj/tx.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/silkaj/tx.py b/silkaj/tx.py
index 7f62613d..5f14c006 100644
--- a/silkaj/tx.py
+++ b/silkaj/tx.py
@@ -180,7 +180,7 @@ def generate_and_send_transaction(
                 issuers,
                 totalAmountInput,
                 listinput_and_amount,
-                outputAddresses,
+                issuers,
                 "Change operation",
             )
             transaction += sign_document_from_seed(transaction, seed) + "\n"
@@ -251,8 +251,11 @@ def generate_transaction_document(
     ################
     listoutput = []
     # Outputs to receiver (if not himself)
-    for outputAddress in outputAddresses:
+    if isinstance(outputAddresses, str):
         generate_output(listoutput, curentUnitBase, AmountTransfered, outputAddresses)
+    else:
+        for outputAddress in outputAddresses:
+            generate_output(listoutput, curentUnitBase, AmountTransfered, outputAddress)
 
     # Outputs to himself
     rest = totalAmountInput - totalAmountTransfered
-- 
GitLab