<p>Try this. You can add several outputs to a transaction</p>

<pre><code> SendRequest req;
 Transaction transaction = null;

transaction = new Transaction(this.activity.getNetWorkParameters());
        transaction.addOutput(coin1,address1);
        transaction.addOutput(coin2,address2);
        req = SendRequest.forTx(transaction);
</code></pre>

CC BY-SA 3.0
2016-06-14T15:21:46.437Z
2016-06-14T15:21:46.437Z
jgm
<p>I am creating a wallet app using the <code>bitcoinj</code> library. I have a use-case where I need to send bitcoins to multiple recipients in one transaction. Currently, I am creating multiple send requests for each address but only first send request is successful and rest of the requests failed and give me following error:</p>

<pre><code>Exception in thread "AWT-EventQueue-0" org.bitcoinj.core.Wallet$DustySendRequested
   at org.bitcoinj.core.Wallet.completeTx(Wallet.java:3646)
   at org.bitcoinj.core.Wallet.sendCoinsOffline(Wallet.java:3471)
   at org.bitcoinj.core.Wallet.sendCoins(Wallet.java:3536)
   at org.bitcoinj.core.Wallet.sendCoins(Wallet.java:3506)....
</code></pre>

<p>Please help me to sort this out. I would be very thankful.</p>

<bitcoinj><raw-transaction>
How to send money to set of recipients using bitcoinj
rashidmdk
# How to send money to set of recipients using bitcoinj

(Asked by: username_0 on 2016-06-11)

I am creating a wallet app using the `bitcoinj` library. I have a use-case where I need to send bitcoins to multiple recipients in one transaction. Currently, I am creating multiple send requests for each address but only first send request is successful and rest of the requests failed and give me following error:

```
Exception in thread "AWT-EventQueue-0" org.bitcoinj.core.Wallet$DustySendRequested
   at org.bitcoinj.core.Wallet.completeTx(Wallet.java:3646)
   at org.bitcoinj.core.Wallet.sendCoinsOffline(Wallet.java:3471)
   at org.bitcoinj.core.Wallet.sendCoins(Wallet.java:3536)
   at org.bitcoinj.core.Wallet.sendCoins(Wallet.java:3506)....

```

Please help me to sort this out. I would be very thankful.

**Tags:** bitcoinj, raw-transaction


---

## 1 answers

### Answer by username_1 on 2016-06-14. Score: 1

Try this. You can add several outputs to a transaction

```
 SendRequest req;
 Transaction transaction = null;

transaction = new Transaction(this.activity.getNetWorkParameters());
        transaction.addOutput(coin1,address1);
        transaction.addOutput(coin2,address2);
        req = SendRequest.forTx(transaction);

```


---

