aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorkiel barry <kiel.j.barry@gmail.com>2018-05-03 20:15:33 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-05-03 20:15:33 +0800
commit5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b (patch)
treef7615b921cfb86a68ae57dc2034595ca5c3927e6 /eth
parent60b433ab84589c2a33553575677bfa61ae3d1078 (diff)
downloadgo-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.tar
go-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.tar.gz
go-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.tar.bz2
go-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.tar.lz
go-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.tar.xz
go-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.tar.zst
go-tangerine-5b3af4c3d1455bc3e4a1c4aa514423683c8aaf7b.zip
eth: golint updates for this or self warning (#16632)
* eth/*:golint updates for this or self warning * eth/*: golint updates for this or self warning, pr updated per feedback
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go12
-rw-r--r--eth/handler.go28
2 files changed, 20 insertions, 20 deletions
diff --git a/eth/backend.go b/eth/backend.go
index ffd5d8542..a26ccd044 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -325,13 +325,13 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
return common.Address{}, fmt.Errorf("etherbase must be explicitly specified")
}
-// set in js console via admin interface or wrapper from cli flags
-func (self *Ethereum) SetEtherbase(etherbase common.Address) {
- self.lock.Lock()
- self.etherbase = etherbase
- self.lock.Unlock()
+// SetEtherbase sets the mining reward address.
+func (s *Ethereum) SetEtherbase(etherbase common.Address) {
+ s.lock.Lock()
+ s.etherbase = etherbase
+ s.lock.Unlock()
- self.miner.SetEtherbase(etherbase)
+ s.miner.SetEtherbase(etherbase)
}
func (s *Ethereum) StartMining(local bool) error {
diff --git a/eth/handler.go b/eth/handler.go
index 4069359c9..c8f7e13f1 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -725,25 +725,25 @@ func (pm *ProtocolManager) BroadcastTx(hash common.Hash, tx *types.Transaction)
}
// Mined broadcast loop
-func (self *ProtocolManager) minedBroadcastLoop() {
+func (pm *ProtocolManager) minedBroadcastLoop() {
// automatically stops if unsubscribe
- for obj := range self.minedBlockSub.Chan() {
+ for obj := range pm.minedBlockSub.Chan() {
switch ev := obj.Data.(type) {
case core.NewMinedBlockEvent:
- self.BroadcastBlock(ev.Block, true) // First propagate block to peers
- self.BroadcastBlock(ev.Block, false) // Only then announce to the rest
+ pm.BroadcastBlock(ev.Block, true) // First propagate block to peers
+ pm.BroadcastBlock(ev.Block, false) // Only then announce to the rest
}
}
}
-func (self *ProtocolManager) txBroadcastLoop() {
+func (pm *ProtocolManager) txBroadcastLoop() {
for {
select {
- case event := <-self.txCh:
- self.BroadcastTx(event.Tx.Hash(), event.Tx)
+ case event := <-pm.txCh:
+ pm.BroadcastTx(event.Tx.Hash(), event.Tx)
// Err() channel will be closed when unsubscribing.
- case <-self.txSub.Err():
+ case <-pm.txSub.Err():
return
}
}
@@ -760,13 +760,13 @@ type NodeInfo struct {
}
// NodeInfo retrieves some protocol metadata about the running host node.
-func (self *ProtocolManager) NodeInfo() *NodeInfo {
- currentBlock := self.blockchain.CurrentBlock()
+func (pm *ProtocolManager) NodeInfo() *NodeInfo {
+ currentBlock := pm.blockchain.CurrentBlock()
return &NodeInfo{
- Network: self.networkId,
- Difficulty: self.blockchain.GetTd(currentBlock.Hash(), currentBlock.NumberU64()),
- Genesis: self.blockchain.Genesis().Hash(),
- Config: self.blockchain.Config(),
+ Network: pm.networkId,
+ Difficulty: pm.blockchain.GetTd(currentBlock.Hash(), currentBlock.NumberU64()),
+ Genesis: pm.blockchain.Genesis().Hash(),
+ Config: pm.blockchain.Config(),
Head: currentBlock.Hash(),
}
}