Transaction not broadcasting on peer network(Blockchain)

-1

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.

Aman Vyas

Posted 2018-04-12T11:00:55.847

Reputation: 73

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 2018-05-30T06:52:12.987

I am using the SPV chain wayAman Vyas 2018-05-31T16:02:59.787

Answers

-1

Use

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

Zombie

Posted 2018-04-12T11:00:55.847

Reputation: 528

Can you provide additional information about what that does and why it solves the asker's problem?David A. Harding 2018-06-03T15:57:54.277

1

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 2018-06-03T17:43:11.600