diff options
-rw-r--r-- | cmd/geth/js.go | 1 | ||||
-rw-r--r-- | cmd/mist/assets/examples/coin.html | 2 | ||||
-rw-r--r-- | core/chain_manager.go | 10 | ||||
-rw-r--r-- | xeth/xeth.go | 6 |
4 files changed, 6 insertions, 13 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go index 59a8469fa..ec3b7a7ae 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -136,6 +136,7 @@ var net = web3.net; utils.Fatalf("Error setting namespaces: %v", err) } + js.re.Eval(registrar + "registrar = new Registrar(" + registrarAddr + ");") } func (self *jsre) ConfirmTransaction(tx *types.Transaction) bool { diff --git a/cmd/mist/assets/examples/coin.html b/cmd/mist/assets/examples/coin.html index 257a19977..e78f2d73f 100644 --- a/cmd/mist/assets/examples/coin.html +++ b/cmd/mist/assets/examples/coin.html @@ -87,7 +87,7 @@ window.filter = filter; function refresh() { - document.querySelector("#balance").innerHTML = contract.call({from:eth.coinbase}).balance(eth.coinbase); + document.querySelector("#balance").innerHTML = contract.balance(eth.coinbase); } function transact() { diff --git a/core/chain_manager.go b/core/chain_manager.go index f05a6bd72..5ad1dda83 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -50,15 +50,7 @@ func CalcDifficulty(block, parent *types.Header) *big.Int { } func CalculateTD(block, parent *types.Block) *big.Int { - uncleDiff := new(big.Int) - 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) + td := new(big.Int).Add(parent.Td, block.Header().Difficulty) return td } diff --git a/xeth/xeth.go b/xeth/xeth.go index 407fe69d5..c1a2ec283 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -18,12 +18,12 @@ import ( "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/event/filter" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/rlp" ) var ( - pipelogger = logger.NewLogger("XETH") filterTickerTime = 5 * time.Minute defaultGasPrice = big.NewInt(10000000000000) //150000000000 defaultGas = big.NewInt(90000) //500000 @@ -218,7 +218,7 @@ func (self *XEth) EthTransactionByHash(hash string) (tx *types.Transaction, blha blnum = big.NewInt(int64(txExtra.BlockIndex)) txi = txExtra.Index } else { - pipelogger.Errorln(err) + glog.V(logger.Error).Infoln(err) } return @@ -676,7 +676,7 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt if contractCreation { addr := core.AddressFromMessage(tx) - pipelogger.Infof("Contract addr %x\n", addr) + glog.V(logger.Info).Infof("Contract addr %x\n", addr) return core.AddressFromMessage(tx).Hex(), nil } |