Commit graph

6 commits

Author SHA1 Message Date
Dave Collins
2988289d2e Implement memory chain pruning.
This commit implements pruning for the block nodes that form the memory
chain which are no longer needed.  The validation of a block only requires
information from a set number of previous nodes.  The initial code did not
prune old nodes as they were no longer needed, but the vast majority of
the infrastructure to support it was already in place as that was always
the goal.  This commit finishes implementing the missing bits to make it
a reality.
2013-08-01 11:31:52 -05:00
Dave Collins
e5eaaee91c Remove a couple of error logs that are not needed. 2013-07-29 22:31:05 -05:00
Dave Collins
882d1c1687 Ensure height is set on block as well as the node.
Even though the code currently makes heavy use of nodes which will have
the appropriate height, blocks which did not come from the database will
not have a height set.  As a result, this could possibly result in a
height of 0 being used when unintended.  By setting the block height in
the block as soon as its known (regardless of the source), we can future
proof against bugs that would likely be hard to track down.
2013-07-29 16:58:48 -05:00
Dave Collins
1deeb05627 Add a few log error messages.
In addition to returning errors to the caller, log the error with a prefix
in a few key places that helps identify the origin for errors.  In some
cases, the underlying error comes from a different subsystem such as the
SQL database driver and the error messages can be fairly generic.
2013-07-24 12:31:14 -05:00
Dave Collins
f219ed5baf Add support for params based on active network.
This commit modifies the code to use params based on the active network
which paves the way for supporting the special rules and different genesis
blocks used by the test networks.
2013-07-24 12:26:17 -05:00
Dave Collins
aa5847f3cc Initial implementation. 2013-07-19 08:50:13 -05:00