How to receive transaction in bitcoinj wallet

1

I am a real noob with bitcoin and bitcoin. I have a lot of questions and I don't know where to start. Let me try.

I have a bitcoin-qt client and I downloaded the chain (took me one day) and now I am playing with bitcoinj.

  • Can I use the block chain downloaded with bitcoin-qt with bitcoinj ? If yes how ?

I created a wallet with bitcoinj client and I get the adress inside it and send money from my bitcoin-qt client to this address.

  • Do I need to download the block chain to receive this btc ?

There is this code:

// We want to know when the balance changes.
wallet.addEventListener(new AbstractWalletEventListener() {
    public void onCoinsReceived(Wallet w, Transaction tx, BigInteger prevBalance, BigInteger newBalance) {
        // Running on a peer thread.
    }
}
  • Do this code need the block chain ?

Thanks for your answers and the help.

Baptiste Pernet

Posted 2013-03-18T14:07:57.647

Reputation: 145

Answers

1

Technically you don't need to have an updated blockchain to receive coins: just create an address and anyone will be able to send to that address. Until the blockchain is updated, you won't see those incoming coins, so you won't be able to spend them, but you will as soon as the update finishes.

o0'.

Posted 2013-03-18T14:07:57.647

Reputation: 5 180