jbenet/go-ipfs — pull request #183 by ehmry (2014-10-17 21:38:35+00:00)
Title: Dagservice interface

There are two things going on here, the first converts DAGService to an interface. That means anything backed by DAGService can be transparently backed by a local blockstore or RPC.

The second is replacing the BlockSplitter Split() function with Next(). Split() currently returns a channel that blocks are passed down. Next() returns a []byte and an error. I did this because I was getting non-deterministic junk blocks when I had GOMAXPROCS > 1 and was using an RPC DAGService (I didn't find out why). This method also passes errors from the reader back to the block consumer, which is good. It also appears to be slighty more performant, but not significantly so.