gcash/bchwallet

Experimental gRPC API NextAddress call never returns

bonedaddy opened this issue · 3 comments

I'm attempting to use the experimental gRPC API to generate an address, however it never completes and the connection will eventually timeout:

The only logs, even on debug mode are:

2019-05-15 17:41:37.300 [INF] GRPC: Unary method /walletrpc.WalletService/NextAddress invoked by <ip>:33470

Here is the code I'm using to make the request https://github.com/RTradeLtd/Temporal/blob/payments/bch/api/v2/routes_payment.go#L227

Here is the code I use to instantiate the client https://github.com/RTradeLtd/Temporal/blob/payments/bch/grpc-clients/bch.go

Thanks. I think this is a known issue. There's some poorly designed code in this repo. Basically to generate a new address it needs to access the database but, at least on startup, the database lock is held by the rescan code.

I believe if you give it a little bit to finish syncing the lock will be released and you can use NextAddress alternatively I did refactor CurrentAddress so that it's not dependent on the db lock so if CurrentAddress works for your use case I would recommend using that instead. CurrentAddress generates a new one each time coins are received on the address.

The reactor to work around this issue is going to be a big one.

Ah okay I see, so until my bchd node is fully synced then NextAddress wont work? I'll try CurrentAddress

edit: Just tried CurrentAddress and it appears to be working. Thanks for the suggestion

Going to close this as CurrentAddress is working =)