core, miner: miner header validation, transaction & receipt writing

* Miners do now verify their own header, not their state.
* Changed old putTx and putReceipts to be exported
* Moved writing of transactions and receipts out of the block processer
  in to the chain manager. Closes #1386
* Miner post ChainHeadEvent & ChainEvent. Closes #1388
This commit is contained in:
Jeffrey Wilcke
2015-07-03 11:24:42 +02:00
parent 03129e7c93
commit 29e2fb38f8
15 changed files with 126 additions and 89 deletions

View File

@@ -18,7 +18,7 @@ func proc() (*BlockProcessor, *ChainManager) {
var mux event.TypeMux
genesis := GenesisBlock(0, db)
chainMan, err := NewChainManager(genesis, db, db, thePow(), &mux)
chainMan, err := NewChainManager(genesis, db, db, db, thePow(), &mux)
if err != nil {
fmt.Println(err)
}
@@ -64,7 +64,7 @@ func TestPutReceipt(t *testing.T) {
Index: 0,
}})
putReceipts(db, hash, types.Receipts{receipt})
PutReceipts(db, hash, types.Receipts{receipt})
receipts, err := getBlockReceipts(db, hash)
if err != nil {
t.Error("got err:", err)