Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Reduce inefficiency of GetAccountAddress() #7262
Conversation
|
utACK |
|
NACK accounts are deprecated performance improvements for code which will be removed isn't worth it |
|
@pstratem is there a concrete list of deprecations somewhere? |
|
Why do they still exist if they were deprecated prior to |
|
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. |
|
@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 If its staying around for a few more versions, then, IMHO, we should maintain it (aka, ACK). |
|
No problem with using bitcoin core's wallet implementation, but indeed, the accounts mechanism is going to be removed at some point. |
|
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. |
|
@laanwj if anything we should be making these rpc calls slow in the hope that people notice they're deprecated |
laanwj
added
the
Wallet
label
Jan 7, 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. |
luke-jr
commented on the diff
Jan 15, 2016
| - ++it) | ||
| - { | ||
| - const CWalletTx& wtx = (*it).second; | ||
| - BOOST_FOREACH(const CTxOut& txout, wtx.vout) | ||
| - if (txout.scriptPubKey == scriptPubKey) | ||
| - bKeyUsed = true; | ||
| + if (!bForceNew) { | ||
| + if (!account.vchPubKey.IsValid()) | ||
| + bForceNew = true; | ||
| + else { | ||
| + // Check if the current key has been used | ||
| + CScript scriptPubKey = GetScriptForDestination(account.vchPubKey.GetID()); | ||
| + for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); | ||
| + it != pwalletMain->mapWallet.end() && account.vchPubKey.IsValid(); | ||
| + ++it) | ||
| + BOOST_FOREACH(const CTxOut& txout, (*it).second.vout) |
luke-jr
Member
|
|
Also utACK, with mentioned nit. |
|
utACK. |
laanwj
merged commit 2409865
into
bitcoin:master
Jan 22, 2016
1 check passed
added a commit
that referenced
this pull request
Jan 22, 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. |
|
@luke-jr er... why? |
|
Gets a non-reused address without filling the wallet with keys that invalidate backups. |
dooglus commentedDec 29, 2015