Skip to content
Permalink
Browse files

Add extra

  • Loading branch information...
maran committed May 27, 2015
1 parent 01f2fa9 commit fbb015c3a95195dbc42c01d4f9a4878f28e097dd
Showing with 4 additions and 2 deletions.
  1. +3 −1 importer.go
  2. +1 −1 main.go
@@ -57,6 +57,7 @@ type Block struct {
GasUsed string `bson:"gas_used"`
Time uint64
TxAmount uint64 `bson:"tx_amount"`
Extra string `bson:"extra"`
Nonce string
StorageSize string `bson:"storage_size"`
MixDigest string `bson:"mix_digest"`
@@ -87,8 +88,9 @@ func (self *ImportMaster) importBlock(block *types.Block) {
txAmount := uint64(len(block.Transactions()))

glog.V(logger.Info).Infoln("Importing block", blockHash, "Hash with ", txAmount, "transactions")
extData := string(block.Header().Extra[:])

err := self.blockCollection.Insert(&Block{blockHash, block.ParentHash().Hex(), block.Header().UncleHash.Hex(), block.Header().Coinbase.Hex(), block.Header().Root.Hex(), block.Header().TxHash.Hex(), block.Header().ReceiptHash.Hex(), block.Header().Number.String(), block.Header().Difficulty.String(), block.Header().GasLimit.String(), block.Header().GasUsed.String(), block.Header().Time, txAmount, string(block.Nonce()), block.Size().String(), block.Header().MixDigest.Hex(), false, nil})
err := self.blockCollection.Insert(&Block{blockHash, block.ParentHash().Hex(), block.Header().UncleHash.Hex(), block.Header().Coinbase.Hex(), block.Header().Root.Hex(), block.Header().TxHash.Hex(), block.Header().ReceiptHash.Hex(), block.Header().Number.String(), block.Header().Difficulty.String(), block.Header().GasLimit.String(), block.Header().GasUsed.String(), block.Header().Time, txAmount, extData, string(block.Nonce()), block.Size().String(), block.Header().MixDigest.Hex(), false, nil})
if err != nil {
clilogger.Infoln(err)
}
@@ -14,7 +14,7 @@ import (
)

const (
Version = "0.0.1"
Version = "0.0.2"
)

var (

0 comments on commit fbb015c

Please sign in to comment.
You can’t perform that action at this time.