Ok, managed to solve this.

I've read some other documentation and realized that addresses coming from 
the regtest should start with n or m.

This address isn't so verified if I'm decoding the hash correctly and I 
wasn't.

Realised that the Address has toBase58 method which decoded the hash 
correctly for me and I can issue money.

Works great!

On Friday, 15 December 2017 13:18:43 UTC+1, Łukasz M. wrote:
>
> Hello all,
>
> I'm trying to build a simple app using bitcoinj and want to creating 
> integration test using* bitcoind -regtest -daemon*. I've ran the generate 
> 101 command.
> I've created a wallet app kit and connected it to localhost, I can get the 
> balance(0.00), fresh address(0c4cc22bd4b324b9bdf7f9e2e43bccc511fe3769).
>
> Sending coin now unsurprisingly throws an exception about insufficient 
> funds, so I want to send some money to the wallet.
>
> My attempt with using the fresh receive address retrieved from the kit
> bitcoin-cli -regtest sendtoaddress 
> 0c4cc22bd4b324b9bdf7f9e2e43bccc511fe3769 10.00
> error code: -5
> error message:
> Invalid Bitcoin address
>
> I'm confusing the different types of address or there needs to be an 
> additional steps maken pass the money to that account?
>
> Thanks,
> Łukasz
>

-- 
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.

Reply via email to