Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testnet blockchain not keeping up to date #47

Closed
genjix opened this issue Jan 23, 2015 · 1 comment
Closed

testnet blockchain not keeping up to date #47

genjix opened this issue Jan 23, 2015 · 1 comment

Comments

@genjix
Copy link
Contributor

genjix commented Jan 23, 2015

On testnet my blockchain keeps falling behind but this doesn't happen on mainnet. It's a problem that I've tried many approaches to, until I noticed that many of the blocks on testnet seem to happen all at once:

http://tbtc.blockr.io/

And then I noticed these warnings:

00:42:14.256872 WARNING [poller]: Storing block 0000000013c7afcc1c74ff9a035ff195b6370a30c271ffd58c0c4b76af9f8684: Timestamp too far in the future
00:44:57.013515 WARNING [poller]: Storing block 0000000013c7afcc1c74ff9a035ff195b6370a30c271ffd58c0c4b76af9f8684: Timestamp too far in the future
00:55:27.380943 WARNING [poller]: Storing block 000000002fca961dc15d9db0bd7570673be740d3e54ebeb8d057152f07464adb: Timestamp too far in the future
00:57:32.134283 WARNING [poller]: Storing block 000000002fca961dc15d9db0bd7570673be740d3e54ebeb8d057152f07464adb: Timestamp too far in the future
00:59:33.896819 WARNING [poller]: Storing block 000000002fca961dc15d9db0bd7570673be740d3e54ebeb8d057152f07464adb: Timestamp too far in the future
01:01:31.168644 WARNING [poller]: Storing block 000000002fca961dc15d9db0bd7570673be740d3e54ebeb8d057152f07464adb: Timestamp too far in the future

So obviously this rule in check_block(), does not apply to testnet:

https://github.com/libbitcoin/libbitcoin-blockchain/blob/master/src/validate.cpp#L376

const ptime block_time = from_time_t(blk_header.timestamp);
const ptime two_hour_future =
    second_clock::universal_time() + hours(2);
if (block_time > two_hour_future)
    return error::futuristic_timestamp;

I'm trying to find where in the Satoshi source code this rule is excluded but haven't found it yet.

@genjix
Copy link
Contributor Author

genjix commented Jan 23, 2015

Ah nevermind clock is not set correctly on my server!

block #319275
000000000f142de3cf9dc3edac69fe59d893142cf6fc92c61b312705d4d39d99
http://tbtc.blockr.io/block/info/319275
Time: 2015-01-23 04:26:57

On my server block timestamp is: 2015-Jan-23 03:26:57
$ date
Fri Jan 23 01:24:18 UTC 2015

UTC time now = London Fri 01:24

@genjix genjix closed this as completed Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant