Author

Topic: in bitcoin miner.cpp what means nblocksize (Read 163 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
December 29, 2017, 04: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.
member
Activity: 100
Merit: 11
December 29, 2017, 04:20:43 AM
#6
the code nBlockSize 1000 is in miner.cpp in versions 0.9.4
Is it in kB ?
legendary
Activity: 1386
Merit: 1053
Please do not PM me loan requests!
December 29, 2017, 04: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.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
December 29, 2017, 03: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
staff
Activity: 3458
Merit: 6793
Just writing some code
December 29, 2017, 02: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.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
December 28, 2017, 09:29:50 AM
#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.
member
Activity: 100
Merit: 11
December 28, 2017, 07:03:52 AM
#1
thanks
Jump to: