aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_manager.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-03-21 22:06:23 +0800
committerMaran <maran.hidskes@gmail.com>2014-03-21 22:06:23 +0800
commitb52b1fca89fd56549ecc0f086d96a39d6009e568 (patch)
tree9e3de2573149ffabfa0eff9b81e4849ad5af36ae /ethchain/state_manager.go
parentae837c4719855384921fcaadb1a575942dc9833d (diff)
downloadgo-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.tar
go-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.tar.gz
go-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.tar.bz2
go-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.tar.lz
go-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.tar.xz
go-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.tar.zst
go-tangerine-b52b1fca89fd56549ecc0f086d96a39d6009e568.zip
Initial block reorganisation code
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r--ethchain/state_manager.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go
index 46d8228d9..9118db211 100644
--- a/ethchain/state_manager.go
+++ b/ethchain/state_manager.go
@@ -201,7 +201,6 @@ func (sm *StateManager) ProcessBlock(block *Block, dontReact bool) error {
return nil
}
-
func (sm *StateManager) CalculateTD(block *Block) bool {
uncleDiff := new(big.Int)
for _, uncle := range block.Uncles {
@@ -215,6 +214,9 @@ func (sm *StateManager) CalculateTD(block *Block) bool {
// The new TD will only be accepted if the new difficulty is
// is greater than the previous.
+ fmt.Println("new block td:", td)
+ fmt.Println("cur block td:", sm.bc.TD)
+
if td.Cmp(sm.bc.TD) > 0 {
// Set the new total difficulty back to the block chain
sm.bc.SetTotalDifficulty(td)