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

Address Book related Fixes #358

Closed
wants to merge 3 commits into from
Closed

Conversation

sgimenez
Copy link
Contributor

This is a rebased series of patches from pull request #335

  1. Fix the synchronization of sending addresses between a CWallet and its associated CWalletDB (this was reported independently in Issue CWallet: fix mapAddress book update #350).

  2. Add a check for validity of sending addresses (Issue Validity of sending addresses in the Address Book. #328).

  3. Avoid propagation of unnecessary updates to CWalletDB.

  4. Fix the behavior of setaccount on sending addresses that are already listed in the Address Book. (Issue Using setaccount on addresses that are already listed in the Address Book. #329).

  5. Add wallet methods GetDefaultAddress and SetDefaultAddress (contributed by laanwj in Issue CWallet: fix mapAddress book update #350).

@sipa
Copy link
Member

sipa commented Jun 28, 2011

  1. ACK
  2. ACK; I don't like using mapPubKeys as a check for whether a key is ours though (there's pwalletMain->HaveKey()), but for now it's correct.
  3. ACK
  4. NAK: you change the check for whether the key belongs to a certain account, but still look it up there the next line?
  5. I like accessor functions for those things, but a GetDefaultAddress should return the address corresponding to vchDefaultKey, and SetDefaultAddress should update vchDefaultKey (and push to db), imho.

@sgimenez
Copy link
Contributor Author

Ok i've amended the commits.

About 4), I assumed previously that mapPubKey contained a subset of mapAddressBook. Maybe it is (or will become) false, but anyway it is better to add the check.

About 5), I hope I've done the wanted changes.

About HaveKey(), there are many other occurrences of mapPubKeys that should be replaced as well.
So it's probably better to leave it unchanged until a global substitution is performed.

@sipa
Copy link
Member

sipa commented Jun 28, 2011

mapPubKeys is not a subset of mapAddressBook; it contains reserve keys while mapAddressBook doesn't. You can assume for now that mapPubKeys does contain all 'our' keys though, and ignore HaveKey for now.

@sgimenez
Copy link
Contributor Author

Indeed. Reserve keys!
Thank you.

@jrmithdobbs
Copy link
Contributor

Can we get a breakdown of the original problems this addresses instead of just what was done to correct them?

@sgimenez
Copy link
Contributor Author

  1. If you need a concrete appearance of the underlying problem, make some changes in your address book using the gui (current head), close the address book window, open it again. Changes are not displayed.

  2. and 4) see respective links.

  3. and 5) are just improvements.

@sipa
Copy link
Member

sipa commented Jun 30, 2011

ACK.

@TheBlueMatt
Copy link
Contributor

NACK - crashes when loading from empty .bitcoin - "Error to load wallet.dat"

@TheBlueMatt
Copy link
Contributor

Problem first showed up in 0efc5d29a2d8922b10dcd02a1f1ad7b46258edd8, Ill let you do the rest.

@sgimenez
Copy link
Contributor Author

sgimenez commented Jul 1, 2011

Yes a small issue with big consequences.
The address name "" was generated as the default "map"ed value, and therefore it was not written to db.

Note to myself, I should really keep away from languages that allow me to make such stupid mistakes :-)

@sgimenez
Copy link
Contributor Author

Status update.

  1. has been pulled.

  2. and 4) are still pending fixes for outstanding bugs.
    Note: expect merge conflicts with recent work by sipa.

@sipa
Copy link
Member

sipa commented Jul 14, 2011

If 1 has been pulled, why is its commit still listed here? Can you do a rebase, removing the already-merged parts?

@sgimenez
Copy link
Contributor Author

Dunno, the first patch was kind of cherry-picked.
Here comes the clean rebase.

@sgimenez
Copy link
Contributor Author

Rebased against recent changes. Removed 5) since its purpose is no so clear now.

@sipa
Copy link
Member

sipa commented Dec 25, 2011

How relevant are these fixes still?

zathras-crypto pushed a commit to zathras-crypto/omnicore that referenced this pull request Apr 18, 2016
6fde93b Add payload creation to the RPC interface (zathras-crypto)
ptschip pushed a commit to ptschip/bitcoin that referenced this pull request Mar 12, 2017
Catch exceptions creating directory paths with -datadir=
hanchon pushed a commit to bitprim/bitcoin that referenced this pull request Aug 17, 2017
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Oct 16, 2019
implement postinst script, fix icons
Losangelosgenetics pushed a commit to Losangelosgenetics/bitcoin that referenced this pull request Mar 12, 2020
cryptapus pushed a commit to cryptapus/bitcoin that referenced this pull request May 3, 2021
f7bc944 Update README.md to reflect new binary situation (yanmaani)

Pull request description:

  That URL is wrong, there are in fact binaries, and there's been binaries since at least 2013.

ACKs for top commit:
  domob1812:
    ACK f7bc944.

Tree-SHA512: 69a26fb397d4121bd6dd94bfd93b93c8568e5620f5ebd25202e2347dda9fbdc31b2576fc4b1e7987d2131a7de50b7a8a2336508bd95b501d961e1673c69da839
@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.

None yet

5 participants