Skip to content

add GetTotalBlocksEstimate() function, move magic number to constant - #327

Closed
laanwj wants to merge 1 commit into
bitcoin:masterfrom
laanwj:totalblocksestimate1
Closed

laanwj wants to merge 1 commit into
bitcoin:masterfrom
laanwj:totalblocksestimate1

Conversation

@laanwj

@laanwj laanwj commented Jun 18, 2011

Copy link
Copy Markdown
Member

For my Qt GUI, I display a progress bar on first start to keep track of how far the initial block chain download is.

This needs a conservative estimate of the total blocks in the chain. Currently, one such estimate is hardcoded into IsInitialBlockDownload as a magic number.

This patch moves the magic number to a constant, and adds a function GetTotalBlocksEstimate() to retrieve the value (always 0 for testnet).

According to the forum topic https://forum.bitcoin.org/index.php?topic=17485.0 it would be possible to compute a real estimate based on version messages; this same interface could later be extended to return this.

@gavinandresen

Copy link
Copy Markdown
Contributor

I approve this pull request.

@laanwj

laanwj commented Jun 25, 2011

Copy link
Copy Markdown
Member Author

Changed nInitialBlockThreshold to 114 after discussion with sipa

@TheBlueMatt

Copy link
Copy Markdown
Contributor

Too late, gavin merged the old version in c774b16, why is this still open?

@lost-tty lost-tty closed this Jun 29, 2011
@laanwj
laanwj deleted the totalblocksestimate1 branch April 9, 2014 14:32
dexX7 added a commit to dexX7/bitcoin that referenced this pull request Jan 4, 2016
7fc0538 Switch to Bitcoin tab in Send page when handling Bitcoin URIs (zathras-crypto)
yourhydra pushed a commit to yourhydra/bitcoin that referenced this pull request Mar 6, 2017
…ning-fix

Silence unused variable warning (secp256k1 test)
destenson pushed a commit to destenson/bitcoin--bitcoin that referenced this pull request Nov 18, 2017
…he mempool

1387fbd [Main] Don't limit zPIV spends from getting into the mempool (Fuzzbawls)

Tree-SHA512: 92ad0dce5ce033adbc5b32d3949b2e2557821c175068e6483dbc6fabcd5747875550d7f7c49ed4df77a3dc2f0b65f287578d4be112d643921d183c28af0aca07
destenson pushed a commit to destenson/bitcoin--bitcoin that referenced this pull request Nov 18, 2017
Since zPIV spends have no fee associated with them (fees are paid up
front during the minting process), the built in rate limiter for
zero-fee transactions was kicking in when it shouldn't have.

This change will allow zPIV spends in `AcceptToMemoryPool()` and
`AcceptableInputs()` to bypass the zero-fee rate limiter.

At the same time, also double the default number of bytes to allow per
minute before rate limiting. Previous default equated to 15000 bytes per
minute, new default is 30000 bytes per minute (exclusive of zPIV
spends).

Github-Pull: bitcoin#327
Rebased-From: 1387fbd
rajarshimaitra pushed a commit to rajarshimaitra/bitcoin that referenced this pull request Aug 5, 2021
@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.

4 participants