Skip to content

Conversation

@dooglus
Copy link
Contributor

@dooglus dooglus commented Dec 29, 2015

  • Don't scan the wallet to see if the current key has been used if we're going to make a new key anyway.
  • Stop scanning the wallet as soon as we see that the current key has been used.
  • Don't call isValid() twice on the current key.

Don't scan the wallet to see if the current key has been used if we're going to make a new key anyway.
Stop scanning the wallet as soon as we see that the current key has been used.
Don't call isValid() twice on the current key.
@dcousens
Copy link
Contributor

utACK

@pstratem
Copy link
Contributor

NACK accounts are deprecated

performance improvements for code which will be removed isn't worth it

@dcousens
Copy link
Contributor

@pstratem is there a concrete list of deprecations somewhere?

@pstratem
Copy link
Contributor

@dcousens #5575

@dcousens
Copy link
Contributor

Why do they still exist if they were deprecated prior to 0.11?
Shouldn't they be removed for 0.12?

@dooglus
Copy link
Contributor Author

dooglus commented Dec 29, 2015

Luke wrote "merchants and exchanges [...] shouldn't be using Bitcoin Core's wallet implementation at all right now" to which sipa responded "whether they should or not, I'm pretty sure that several do, and we don't want them to stop upgrading their software because we drop a feature".

I guess that's the crux of the matter. Dropping a feature that is in use without offering a replacement feature will cause people to either stop upgrading or worse.

@dcousens
Copy link
Contributor

@laanwj this is obviously up to you, but IMHO we should NACK this if it is actually deprecated, then promptly remove all of the accounting features entirely (for 0.13, or even 0.12 if possible, may be too late now though).

If its staying around for a few more versions, then, IMHO, we should maintain it (aka, ACK).

@laanwj
Copy link
Member

laanwj commented Jan 4, 2016

No problem with using bitcoin core's wallet implementation, but indeed, the accounts mechanism is going to be removed at some point.

@laanwj
Copy link
Member

laanwj commented Jan 4, 2016

In any case that's not a reason for not merging this - this doesn't actually extend the API (which would be problematic) but purports make the current implementation more efficient. If this is code review correct and tested there's no reason not to merge it.

@pstratem
Copy link
Contributor

pstratem commented Jan 5, 2016

@laanwj if anything we should be making these rpc calls slow in the hope that people notice they're deprecated

@laanwj laanwj added the Wallet label Jan 7, 2016
@luke-jr
Copy link
Member

luke-jr commented Jan 15, 2016

Note that one reason accounts are not removed yet, is because we have no alternative to getaccountaddress yet... and it's likely this code will get reused in implementing whatever replaces it. So concept ACK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flattening the wtx variable doesn't actually optimise anything, and makes it slightly harder to follow. I'd prefer to not change this aspect.

@luke-jr
Copy link
Member

luke-jr commented Jan 15, 2016

Also utACK, with mentioned nit.

@jonasschnelli
Copy link
Contributor

utACK.
I agree that we should not extend the account API, but – as long as it's not removed – we should maintain it and should therefore accept optimizations.

@laanwj laanwj merged commit 2409865 into bitcoin:master Jan 22, 2016
laanwj added a commit that referenced this pull request Jan 22, 2016
2409865 Reduce inefficiency of GetAccountAddress() (Chris Moore)
@luke-jr
Copy link
Member

luke-jr commented Jan 30, 2016

Perhaps of interest: BFGMiner uses getaccountaddress, and it adds a 1-2 second delay after finding a block, before it switches to mining the next one... Not sure the optimisations here are sufficient, but we definitely should improve this.

@pstratem
Copy link
Contributor

@luke-jr er... why?

@luke-jr
Copy link
Member

luke-jr commented Jan 30, 2016

Gets a non-reused address without filling the wallet with keys that invalidate backups.

luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Feb 13, 2016
Don't scan the wallet to see if the current key has been used if we're going to make a new key anyway.
Stop scanning the wallet as soon as we see that the current key has been used.
Don't call isValid() twice on the current key.

Github-Pull: bitcoin#7262
Rebased-From: 2409865
luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Jun 28, 2016
codablock pushed a commit to codablock/dash that referenced this pull request Dec 9, 2017
2409865 Reduce inefficiency of GetAccountAddress() (Chris Moore)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants