Bitcoin Forum
October 15, 2018, 06:26:56 PM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: in bitcoin miner.cpp what means nblocksize  (Read 44 times)
myapple
Member
**
Offline Offline

Activity: 100
Merit: 10


View Profile
December 28, 2017, 12:03:52 PM
 #1

thanks
1539628016
Hero Member
*
Offline Offline

Posts: 1539628016

View Profile Personal Message (Offline)

Ignore
1539628016
Reply with quote  #2

1539628016
Report to moderator
1539628016
Hero Member
*
Offline Offline

Posts: 1539628016

View Profile Personal Message (Offline)

Ignore
1539628016
Reply with quote  #2

1539628016
Report to moderator
1539628016
Hero Member
*
Offline Offline

Posts: 1539628016

View Profile Personal Message (Offline)

Ignore
1539628016
Reply with quote  #2

1539628016
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
ranochigo
Legendary
*
Offline Offline

Activity: 1568
Merit: 1094

Somewhat inactive.


View Profile WWW
December 28, 2017, 02:29:50 PM
 #2

I think you just answered your own question; remove the n and add a space between the block and the size. In the older versions, it's value is 1000.

I'm not sure what source code you're looking at but Core removed the max block size and replaced it with max block weight. The max block weight is 4000 units. This means that in theory, the block size could potentially be about 4MB but I don't think we would see that.

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1554
Merit: 1700


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
December 29, 2017, 07:44:59 AM
 #3

it's value is 1000....The max block weight is 4000 units.
You've dropped a few zeros. The max block size was 1000000 bytes. The max block weight is 4000000 units.

ranochigo
Legendary
*
Offline Offline

Activity: 1568
Merit: 1094

Somewhat inactive.


View Profile WWW
December 29, 2017, 08:24:30 AM
 #4

it's value is 1000....The max block weight is 4000 units.
You've dropped a few zeros. The max block size was 1000000 bytes. The max block weight is 4000000 units.
Yeah, I'm aware. However, it was stated as 4000 in the source code[1], was 1000 as the block size in the past. Why is it so? Was it counted in terms of KB in the past?


[1] https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp#L397

Taras
Legendary
*
Offline Offline

Activity: 1330
Merit: 1011


Please do not PM me loan requests!


View Profile WWW
December 29, 2017, 09:17:43 AM
 #5

it's value is 1000....The max block weight is 4000 units.
You've dropped a few zeros. The max block size was 1000000 bytes. The max block weight is 4000000 units.
Yeah, I'm aware. However, it was stated as 4000 in the source code[1], was 1000 as the block size in the past. Why is it so? Was it counted in terms of KB in the past?


[1] https://github.com/bitcoin/bitcoin/blob/master/src/miner.cpp#L397
Actually that's a separate variable which is nBlockMaxWeight (4000000) minus 4000 units. It's just checking if the block is "almost full" of transactions (meaning, weight of at least 3996000, which is 99.9% capacity).

The maximum weight itself is defined as 4000000 in consensus.h here.
myapple
Member
**
Offline Offline

Activity: 100
Merit: 10


View Profile
December 29, 2017, 09:20:43 AM
 #6

the code nBlockSize 1000 is in miner.cpp in versions 0.9.4
Is it in kB ?
ranochigo
Legendary
*
Offline Offline

Activity: 1568
Merit: 1094

Somewhat inactive.


View Profile WWW
December 29, 2017, 09:45:49 AM
 #7

Actually that's a separate variable which is nBlockMaxWeight (4000000) minus 4000 units. It's just checking if the block is "almost full" of transactions (meaning, weight of at least 3996000, which is 99.9% capacity).

The maximum weight itself is defined as 4000000 in consensus.h here.
Oh. That makes so much more sense now. Cheesy Thanks!
the code nBlockSize 1000 is in miner.cpp in versions 0.9.4
Is it in kB ?
Bytes. But it doesn't concern the whole Block size. I realised I've read the whole code wrongly and I had to read it again.

The 1000 value you see isn't the actual block size. The whole point for that line of code is to reserve the coinbase transaction, which they assume to be 1000bytes. If you read the code later on, it would prevent the client from including too many transactions, such that they are unable to include the coinbase transaction.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!