Commit Graph

3 Commits

Author SHA1 Message Date
Dave Collins
60779ea8df Add message blocking semantics to block processing.
This commit modifies the input message handler so that when a remote peer
sends a block, no further messages from that peer are accepted until the
block has been fully processed and therefore known good or bad.  This
helps prevent a malicious peer from queueing up a bunch of bad blocks
before disconnecting (or being disconnected) and wasting memory.

Additionally, this behavior is depended on by at least the block
acceptance test tool as the reference implementation processes blocks in
the same thread and therefore blocks further messages until the block has
been fully processed as well.
2013-08-16 13:40:05 -05:00
Dave Collins
eab9c1f0c1 Insert genesis block if needed on db load.
Previously, the genesis block was only inserted when the database was
created, but it's possible due to rollback that the database is created
and the genesis block insert gets rolled back if the app is existed too
quickly.  This commit modifies the logic to test the need for the genesis
block any time the database is loaded and insert it if necessary.
2013-08-08 00:47:48 -05:00
Dave Collins
8574846e87 Move btcd to root directory.
This allows easier go get paths.
2013-08-07 12:47:51 -05:00