aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-20 18:01:20 +0800
committerobscuren <geffobscura@gmail.com>2015-04-20 18:01:20 +0800
commit97b0c4b6978d7fd972f3b0991acca1227e4e83dc (patch)
tree8c6f35d6e82fa809a06694635c331bb8103b8907 /core/types
parentfa729a0c55aa4b00c2ac33d0fcee8acabed2f737 (diff)
downloaddexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.tar
dexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.tar.gz
dexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.tar.bz2
dexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.tar.lz
dexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.tar.xz
dexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.tar.zst
dexon-97b0c4b6978d7fd972f3b0991acca1227e4e83dc.zip
core: moved TD calculation from proc to chain
Diffstat (limited to 'core/types')
-rw-r--r--core/types/block.go16
-rw-r--r--core/types/common.go2
2 files changed, 8 insertions, 10 deletions
diff --git a/core/types/block.go b/core/types/block.go
index c47b555ed..f9206ec76 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -347,22 +347,20 @@ func (self *Block) Copy() *Block {
}
func (self *Block) String() string {
- return fmt.Sprintf(`BLOCK(%x): Size: %v TD: %v {
-NoNonce: %x
-Header:
-[
+ return fmt.Sprintf(`Block(#%v): Size: %v TD: %v {
+MinerHash: %x
%v
-]
Transactions:
%v
Uncles:
%v
}
-`, self.header.Hash(), self.Size(), self.Td, self.header.HashNoNonce(), self.header, self.transactions, self.uncles)
+`, self.Number(), self.Size(), self.Td, self.header.HashNoNonce(), self.header, self.transactions, self.uncles)
}
func (self *Header) String() string {
- return fmt.Sprintf(`
+ return fmt.Sprintf(`Header(%x):
+[
ParentHash: %x
UncleHash: %x
Coinbase: %x
@@ -377,8 +375,8 @@ func (self *Header) String() string {
Time: %v
Extra: %s
MixDigest: %x
- Nonce: %x`,
- self.ParentHash, self.UncleHash, self.Coinbase, self.Root, self.TxHash, self.ReceiptHash, self.Bloom, self.Difficulty, self.Number, self.GasLimit, self.GasUsed, self.Time, self.Extra, self.MixDigest, self.Nonce)
+ Nonce: %x
+]`, self.Hash(), self.ParentHash, self.UncleHash, self.Coinbase, self.Root, self.TxHash, self.ReceiptHash, self.Bloom, self.Difficulty, self.Number, self.GasLimit, self.GasUsed, self.Time, self.Extra, self.MixDigest, self.Nonce)
}
type Blocks []*Block
diff --git a/core/types/common.go b/core/types/common.go
index 4397d4938..dbdaaba0c 100644
--- a/core/types/common.go
+++ b/core/types/common.go
@@ -10,7 +10,7 @@ import (
)
type BlockProcessor interface {
- Process(*Block) (*big.Int, state.Logs, error)
+ Process(*Block) (state.Logs, error)
}
const bloomLength = 256