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

setaccount creates new address on first rename #34

Open
davidstoneham opened this issue Mar 12, 2018 · 6 comments
Open

setaccount creates new address on first rename #34

davidstoneham opened this issue Mar 12, 2018 · 6 comments

Comments

@davidstoneham
Copy link

When using the setaccount command on an exiting address for the first time a new address is created with the same account rather than changing the account of the original address.

Steps to reproduce:
in the Linda debug console run
getnewaddress myNewAddressLabel
setaccount myNewAddressLabel1

the result will be the original address with label myNewAddressLabel1 and a new address with label myNewAddressLabel

@nisanb
Copy link
Collaborator

nisanb commented Mar 19, 2018

Please review the documentation first about using setaccount and getnewaddress.

@nisanb nisanb closed this as completed Mar 19, 2018
@davidstoneham
Copy link
Author

There isn't any documentation for the RPC commands in this repo?

From the bitcoin documentation:
setaccount | | Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account.
getnewaddress | [account] | Returns a new bitcoin address for receiving payments. If [account] is specified payments received with the address will be credited to [account].

As I've provided in my steps to reproduce above I am using these commands as documented. The issue is creating a new address then renaming it the first time creates 2 new address instead of just re-assigning the account for the address. using set account again doesn't create another address. There seems to be a bug that the wallet isn't registering the existence of the newly created address when using the setaccount command for the first time.

@nisanb
Copy link
Collaborator

nisanb commented Mar 19, 2018

Please use:
setaccount <Lindaaddress> <account>

@nisanb nisanb reopened this Mar 19, 2018
@davidstoneham
Copy link
Author

my apologies there was a type in my initial issues. It should be

Steps to reproduce:
in the Linda debug console run
getnewaddress myNewAddressLabel
setaccount myNewAddressLabel1

the result will be the original address with label myNewAddressLabel1 and a new address with label myNewAddressLabel

@nisanb
Copy link
Collaborator

nisanb commented Mar 19, 2018

May I know what are you trying to achieve?

@davidstoneham
Copy link
Author

@nisanb I'm trying to control a wallet via the RPC interface. My pull request #45 fixes this issue as well as some other RPC related bugs.

The setaccount function was a bit confusing as there shouldn't be any reason to create a new address when changing the account of an existing address. The original issue for this bitcoin/bitcoin#29 was supposed to fix a bug around getaccountaddress but for some reason, they added code in the setaccount function to generate a new address if the account didn't exist

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