:: [Libbitcoin] testnet blockchain not…
Top Page
Delete this message
Reply to this message
Author: Amir Taaki
Date:  
To: libbitcoin@lists.dyne.org
Subject: [Libbitcoin] testnet blockchain not keeping up to date: rule exception for testnet?
Cross posting this here for record keeping:

https://github.com/libbitcoin/libbitcoin-blockchain/issues/47

---------------

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.