Author

Topic: WalletEventListener (Read 2820 times)

legendary
Activity: 1526
Merit: 1129
November 05, 2014, 09:30:12 AM
#2
If it's an address the wallet generated itself, it'll already be "watched". If you want to watch an address you don't have the key for, use wallet.addWatchedAddress.
newbie
Activity: 3
Merit: 0
October 22, 2014, 11:06:55 AM
#1
Just started messing around with bitcoinj 0.12 in eclipse as a java-newbie.

My simple goal is an app that tells me when a given address of my Wallet received coins.
pretty sure I have to use:

Code:
wallet.addEventListener(new AbstractWalletEventListener() {
public void onCoinsReceived(Wallet w, Transaction tx,
BigInteger prevBalance, BigInteger newBalance) {

System.out.println("You have received some Coins");

}
});

But how can I specify the wallet respectively the address that I want to be watched.
I can't figure it out with the help of the documentation:(
Jump to: