Commit graph

6 commits

Author SHA1 Message Date
Dave Collins
df065eee19 Provide a new median time source API.
This commit provides a new interface, MedianTimeSource, along with a
concrete implementation which allows improved accuracy of time by making
use of the median network time as calculated from multiple time samples.

The time samples are to be provided by callers and are intended to come
from remote clients.

The calculations performed in this implementation exactly mirror those in
Bitcoin Core because time calculations are part of the consensus rules and
hence need to match exactly.
2014-10-10 01:12:39 -05:00
David Hill
c3abafc7eb Println -> Printf when using formatting directives.
This makes go vet happy.
2014-08-28 10:23:46 -04:00
Dave Collins
01fa7fa069 Add BigToCompact example. 2014-07-08 07:57:22 -05:00
Dave Collins
1a2baa3099 Add CompactToBig example. 2014-07-08 02:15:41 -05:00
Dave Collins
62c14b7001 Name new example so it shows up properly on godoc. 2014-07-08 01:49:48 -05:00
Dave Collins
94845326b5 Use testable example and update doc.go README.md.
This commit moves the ProcessBlock example to a test file so it integrates
nicely with Go's example tooling.

This allows the example output to be tested as a part of running the
normal Go tests to help ensure it doesn't get out of date with the code.
It is also nice to have the example in one place rather than repeating it
in doc.go and README.md.

Links and information about the example have been incldued in doc.go and
README.md in place of the example.
2014-07-08 01:45:28 -05:00