Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing generate with generatetoaddress #79

Open
RdeWilde opened this issue May 20, 2020 · 1 comment
Open

Replacing generate with generatetoaddress #79

RdeWilde opened this issue May 20, 2020 · 1 comment

Comments

@RdeWilde
Copy link

Now that generate is deprecated, I would like to replace it with generatetoaddress but I am not sure how to get the address to pass along in the code below:

res, err = rpcClient.RequestAndUnmarshalResult(&hashs, "generate", 1)

How do I pass a valid address as extra argument to the call?

@AkioNak
Copy link
Contributor

AkioNak commented May 21, 2020

@RdeWilde Passing an address to generatetoaddress, just add the 4th param like follows:

addr, _ := rpcClient.GetNewAddr(false)
res, err = rpcClient.RequestAndUnmarshalResult(&hashs, "generatetoaddress", 1, addr) 

But, It seems some other codes should be fix to run with the latest version of elements.
I will try to make a PR to fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants