I'm create app with BitcoinJ lib. I have several address and I send them to my Friends, when my friend send money to me I don't know who is he. So I want to know what is sender bitcoin address and what is receive bitcoin address. I'm using this code to detect the address but it alway show all my bitcoin address in my wallet.
public void onCoinsReceived(Wallet w, Transaction tx, Coin prevBalance, Coin newBalance) { List<TransactionInput> inputs = tx.getInputs(); List<TransactionOutput> outputs = tx.getOutputs(); for(TransactionOutput out : outputs){ System.out.println(out.getAddressFromP2PKHScript(params)); System.out.println(out.getAddressFromP2SH(params)); } for(TransactionInput in : inputs){ System.out.println(in.getFromAddress()); } } Please give me a advise. -- You received this message because you are subscribed to the Google Groups "bitcoinj" group. To unsubscribe from this group and stop receiving emails from it, send an email to bitcoinj+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.