Bitcoin Forum
April 18, 2024, 10:58:23 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: WalletEventListener  (Read 2819 times)
profil3r (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
October 22, 2014, 03:06:55 PM
Last edit: October 22, 2014, 11:02:10 PM by profil3r
 #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:(
1713481103
Hero Member
*
Offline Offline

Posts: 1713481103

View Profile Personal Message (Offline)

Ignore
1713481103
Reply with quote  #2

1713481103
Report to moderator
1713481103
Hero Member
*
Offline Offline

Posts: 1713481103

View Profile Personal Message (Offline)

Ignore
1713481103
Reply with quote  #2

1713481103
Report to moderator
1713481103
Hero Member
*
Offline Offline

Posts: 1713481103

View Profile Personal Message (Offline)

Ignore
1713481103
Reply with quote  #2

1713481103
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713481103
Hero Member
*
Offline Offline

Posts: 1713481103

View Profile Personal Message (Offline)

Ignore
1713481103
Reply with quote  #2

1713481103
Report to moderator
1713481103
Hero Member
*
Offline Offline

Posts: 1713481103

View Profile Personal Message (Offline)

Ignore
1713481103
Reply with quote  #2

1713481103
Report to moderator
Mike Hearn
Moderator
Legendary
*
Offline Offline

Activity: 1526
Merit: 1128


View Profile
November 05, 2014, 01:30:12 PM
 #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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!