Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Apr 13, 2011

Information about the best known chain is added to wallet.dat. If this
information does not match the data in blkindex.dat, a rescan is automatically
performed at startup, starting from the the last known block. When upgrading from a wallet
which does not have this information, no rescan is done automatically.

@sipa
Copy link
Member Author

sipa commented Apr 13, 2011

One thing I did not test, is the slowdown. Continuously creating CBlockLocator's and writing them to wallet.dat may slow down initial block download.

@gavinandresen
Copy link
Contributor

Nice! RE: block download speed: I'd suggest a check for if IsInitialBlockDownload() and don't bother writing best-block-index during the initial block download.

@sipa
Copy link
Member Author

sipa commented Apr 13, 2011

Ok, updated.

@gavinandresen
Copy link
Contributor

Looking at this again and thinking about pulling, it seems more complicated than it needs to be-- CBlockLocator can already serialize/deserialize itself, is there a reason for the ReadBestBlock/WriteBestBlock methods? Why not just Read/Write the CBlockLocator instead of CBLockLocator.vHave?

Information about the best known chain is added to wallet.dat. If this
information does not match the data in blkindex.dat, a rescan is automatically
performed, starting from the the last known block. When upgrading from a wallet
which does not have this information, no rescan is done automatically.
@sipa
Copy link
Member Author

sipa commented Apr 17, 2011

I didn't realize db.h did define classes from main.h as well, to use them. I added CBlockLocator to those and simplified the patch.

@gavinandresen
Copy link
Contributor

Pulled via cherry-pick.

dexX7 pushed a commit to dexX7/bitcoin that referenced this pull request Jul 29, 2015
ptschip pushed a commit to ptschip/bitcoin that referenced this pull request Nov 9, 2016
…move_obsolete_rpc-tests_shell_script

remove rpc-tests.sh which was replaced by Python script
destenson pushed a commit to destenson/bitcoin--bitcoin that referenced this pull request Nov 18, 2017
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Dec 9, 2017
classesjack pushed a commit to classesjack/bitcoin that referenced this pull request Jan 2, 2018
…take

Change GetProofOfStake to use header prevout info instead of transaction data
cryptapus added a commit to myriadcoin/myriadcoin that referenced this pull request May 6, 2019
rajarshimaitra pushed a commit to rajarshimaitra/bitcoin that referenced this pull request Mar 23, 2021
cryptapus pushed a commit to cryptapus/bitcoin that referenced this pull request May 3, 2021
4cf815e Add release notes entry for encodings. (Daniel Kraft)
810bc13 Support -name/valueencoding for namecoin-tx. (Daniel Kraft)
20ab39a Handle encodings on the output side. (Daniel Kraft)
482c30e Explicitly use UTF-8 for name_filter regexp check. (Daniel Kraft)
ee7fba9 Introduce EncodeNameForMessage for logs / errors. (Daniel Kraft)
80f8ba0 Move names/encoding library to common lib. (Daniel Kraft)
0688f01 Remove ValtypeFromString. (Daniel Kraft)
9367b48 Use configured encoding for "input" names/values. (Daniel Kraft)
7e364eb Add -nameencoding / -valueencoding options. (Daniel Kraft)
b6b8483 Add new names/encoding source files. (Daniel Kraft)
0a1c72e Expose univalue's UTF-8 validation logic. (Daniel Kraft)

Pull request description:

  This implements the main part of the proposal in bitcoin#246:  New `-nameencoding` and `-valueencoding` options are added, with the possible values of `ascii`, `utf8` and `hex`.  They specify in which encoding name and value data is expected in RPC arguments and returned in JSON fields.  This fixes a long-standing issue Namecoin had with binary data that was invalid UTF-8 (as well as adding proper support for real binary data in the RPC interface).  As a consequence, this likely resolves (or is at least a big part of the solution of) bitcoin#152 and bitcoin#170.

  Still missing for a full solution of bitcoin#246 is the possibility to specify per-RPC encodings in an `options` RPC argument.  For now, the encodings can only be set for the full process at startup time through the config options.

Tree-SHA512: b221c3ccf421517be3419aec568e02475c2562fa1e99a70b7c53332ce343dc78a537285183262b270fb676f7c39cf16a9e58cb8160e2e4653211d0daa77e0437
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants