-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.

2
  • 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. Commented May 30, 2018 at 6:52
  • I am using the SPV chain way
    – Aman Vyas
    Commented May 31, 2018 at 16:02

1 Answer 1

-1

Use

kit.wallet().sendCoins(SendRequest.forTx(tx));
2
  • Can you provide additional information about what that does and why it solves the asker's problem? Commented Jun 3, 2018 at 15:57
  • 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: bitcoinj.github.io/javadoc/0.13/org/bitcoinj/core/…
    – Zombie
    Commented Jun 3, 2018 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.