• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

How to calculate the adjusted time of the next block

JaneEyre17

New member
hi, I have a problem when I calculate the adjusted time of the next block.According to the code of block time,BlockTime=GetAdjustTime,andGetAdjustTime=GetTime+GetTimeOffset.But how can I calculate the GetTimeOffset?

I'm looking forward to your repply. Thanks!
 
1.png


The links below:
https://github.com/dashpay/dash/blob/master/src/main.cpp#L5427
https://github.com/dashpay/dash/blob/master/src/main.cpp#L5311
https://github.com/dashpay/dash/blob/master/src/main.cpp#L5311
 
I'm not sure why you even bothered with calculating adjusted time... basically, all this function is trying to do is to use some data collected from peers to guess if local clocks are off and how much. You do not really need this to mine blocks if your clocks are more or less synced - timestamp in blocks can be off up to 2h, that's completely fine.
 
Back
Top