good morning!!!!

Skip to content
Snippets Groups Projects
Commit 0636e17d authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Added default registrar

parent c6b25a40
No related branches found
No related tags found
No related merge requests found
...@@ -136,6 +136,7 @@ var net = web3.net; ...@@ -136,6 +136,7 @@ var net = web3.net;
utils.Fatalf("Error setting namespaces: %v", err) utils.Fatalf("Error setting namespaces: %v", err)
} }
js.re.Eval(registrar + "registrar = new Registrar(" + registrarAddr + ");")
} }
func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool { func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool {
......
...@@ -50,15 +50,7 @@ func CalcDifficulty(block, parent *types.Header) *big.Int { ...@@ -50,15 +50,7 @@ func CalcDifficulty(block, parent *types.Header) *big.Int {
} }
func CalculateTD(block, parent *types.Block) *big.Int { func CalculateTD(block, parent *types.Block) *big.Int {
uncleDiff := new(big.Int) td := new(big.Int).Add(parent.Td, block.Header().Difficulty)
for _, uncle := range block.Uncles() {
uncleDiff = uncleDiff.Add(uncleDiff, uncle.Difficulty)
}
// TD(genesis_block) = 0 and TD(B) = TD(B.parent) + sum(u.difficulty for u in B.uncles) + B.difficulty
td := new(big.Int)
td = td.Add(parent.Td, uncleDiff)
td = td.Add(td, block.Header().Difficulty)
return td return td
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment