Send the second last block difficulty sum
This counters a possible attack where a miner could try to replace an already mined block with a different one that appears to be mined just one second before.
This commit is contained in:
@@ -74,7 +74,7 @@ block_difficulty = max(calculated_difficulty, 2^28)
|
|||||||
|
|
||||||
Note the max() operation: A difficulty can never be lower than 2^28 (=268435456). This is a strict lower bound.
|
Note the max() operation: A difficulty can never be lower than 2^28 (=268435456). This is a strict lower bound.
|
||||||
|
|
||||||
For the first block, the "difficulty sum" value is set to 2^28.
|
For the first block, the "difficulty sum" value is set to 2^29.
|
||||||
|
|
||||||
Early in the chain, when less than 11 blocks have been mined, we make assumptions for blocks "before" the first block:
|
Early in the chain, when less than 11 blocks have been mined, we make assumptions for blocks "before" the first block:
|
||||||
- Each of these "before" blocks had a block difficulty of exactly 2^28
|
- Each of these "before" blocks had a block difficulty of exactly 2^28
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ If the list contains less than 1024 entries, set "transaction fee", "sender pubk
|
|||||||
| protocol version = 0 (BE) | 2 |
|
| protocol version = 0 (BE) | 2 |
|
||||||
| capable version = 0 (BE) | 2 |
|
| capable version = 0 (BE) | 2 |
|
||||||
| type = 0 (BE) | 1 |
|
| type = 0 (BE) | 1 |
|
||||||
| difficulty sum of last known block (BE) | 32 |
|
| difficulty sum of second last known block (BE) | 32 |
|
||||||
| hash value of open transaction # 1023 | 32 |
|
| hash value of open transaction # 1023 | 32 |
|
||||||
| partner IPv6 | 16 |
|
| partner IPv6 | 16 |
|
||||||
| partner port (BE) | 2 |
|
| partner port (BE) | 2 |
|
||||||
|
|
||||||
The difficulty sum is sent as 0 if no block is known.
|
The difficulty sum is sent as 2^28 if only one block is known or as 0 if no block is known.
|
||||||
|
|
||||||
partner IPv6 and partner port may be nullbytes (no partner included).
|
partner IPv6 and partner port may be nullbytes (no partner included).
|
||||||
|
|||||||
Reference in New Issue
Block a user