<p>Use</p>

<pre><code>kit.wallet().sendCoins(SendRequest.forTx(tx));
</code></pre>

CC BY-SA 4.0
2018-06-03T15:57:54.277Z
Can you provide additional information about what that does and why it solves the asker's problem?
David A. Harding
CC BY-SA 4.0
2018-06-03T17:43:11.600Z
This may not reslove asker problem, but helps to understand the issue, as this will throw an exception if anything wrong in the transaction, according to this: https://bitcoinj.github.io/javadoc/0.13/org/bitcoinj/core/Wallet.html#sendCoins-org.bitcoinj.core.Wallet.SendRequest-
Zombie
CC BY-SA 4.0
2018-05-23T20:21:54.197Z
2018-05-23T20:21:54.197Z
Zombie
<p>I am using Bitcoinj and doing the transaction and I am getting the TX hash but the hash is not showing in any explorer site</p>

<pre><code>SendRequest finalReq = SendRequest.to(toAddress, Coin.parseCoin(ammount).subtract(fAmt));
    kit.wallet().completeTx(finalReq);
    kit.wallet().commitTx(finalReq.tx);
    kit.peerGroup().broadcastTransaction(finalReq.tx);
</code></pre>

<p>Am I doing something wrong.</p>

CC BY-SA 4.0
2018-05-30T06:52:12.987Z
Some confusion to understand the question. 1) Are you working with Online wallet in bitcoinj? (You have both public and private keys) 2) Or you are using watching wallet to spend coins? If you are using watching wallet then process of creating and broadcasting transaction is harder than the online wallet.
Cleo Indigo
CC BY-SA 4.0
2018-05-31T16:02:59.787Z
I am using the SPV chain way
Aman Vyas
<bitcoinj>
Transaction not broadcasting on peer network(Blockchain)
Aman Vyas
# Transaction not broadcasting on peer network(Blockchain)

(Asked by: username_0 on 2018-04-12)

I am using Bitcoinj and doing the transaction and I am getting the TX hash but the hash is not showing in any explorer site

```
SendRequest finalReq = SendRequest.to(toAddress, Coin.parseCoin(ammount).subtract(fAmt));
    kit.wallet().completeTx(finalReq);
    kit.wallet().commitTx(finalReq.tx);
    kit.peerGroup().broadcastTransaction(finalReq.tx);

```

Am I doing something wrong.

**Tags:** bitcoinj

> **Comments:**
> **username_1**: Some confusion to understand the question. 1) Are you working with Online wallet in bitcoinj? (You have both public and private keys) 2) Or you are using watching wallet to spend coins? If you are using watching wallet then process of creating and broadcasting transaction is harder than the online wallet.  
> **username_0**: I am using the SPV chain way  

---

## 1 answers

### Answer by username_2 on 2018-05-23. Score: -1

Use

```
kit.wallet().sendCoins(SendRequest.forTx(tx));

```

> **Comments:**
> **username_3**: Can you provide additional information about what that does and why it solves the asker's problem?  
> **username_2**: This may not reslove asker problem, but helps to understand the issue, as this will throw an exception if anything wrong in the transaction, according to this: https://bitcoinj.github.io/javadoc/0.13/org/bitcoinj/core/Wallet.html#sendCoins-org.bitcoinj.core.Wallet.SendRequest-  

---

