You can use wallet.isPubKeyHashMine(address.getHash160())
to find out if an address is part of your wallet. On 12/14/2017 03:53 PM, Kunal Ransing wrote: > Hi, > > I am using bitcoinj-core-0.14.5. > I am creating addresses for my users using below: > kit.wallet().freshReceiveAddress().toString(); > > Now I want to avoid user's sending coin to another user's address that > belongs to my wallet. > How we can identify that both addresses belong to my wallet? > > Thanks. > > -- > 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 > <mailto:bitcoinj+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout. -- 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.