Skip to content

Commit 5e304cd

Browse files
kielbarrykimmyeonghun
authored andcommitted
eth: golint updates for this or self warning (ethereum#16632)
* eth/*:golint updates for this or self warning * eth/*: golint updates for this or self warning, pr updated per feedback
1 parent afed1d1 commit 5e304cd

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

eth/backend.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
325325
return common.Address{}, fmt.Errorf("etherbase must be explicitly specified")
326326
}
327327

328-
// set in js console via admin interface or wrapper from cli flags
329-
func (self *Ethereum) SetEtherbase(etherbase common.Address) {
330-
self.lock.Lock()
331-
self.etherbase = etherbase
332-
self.lock.Unlock()
328+
// SetEtherbase sets the mining reward address.
329+
func (s *Ethereum) SetEtherbase(etherbase common.Address) {
330+
s.lock.Lock()
331+
s.etherbase = etherbase
332+
s.lock.Unlock()
333333

334-
self.miner.SetEtherbase(etherbase)
334+
s.miner.SetEtherbase(etherbase)
335335
}
336336

337337
func (s *Ethereum) StartMining(local bool) error {

eth/handler.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -725,25 +725,25 @@ func (pm *ProtocolManager) BroadcastTx(hash common.Hash, tx *types.Transaction)
725725
}
726726

727727
// Mined broadcast loop
728-
func (self *ProtocolManager) minedBroadcastLoop() {
728+
func (pm *ProtocolManager) minedBroadcastLoop() {
729729
// automatically stops if unsubscribe
730-
for obj := range self.minedBlockSub.Chan() {
730+
for obj := range pm.minedBlockSub.Chan() {
731731
switch ev := obj.Data.(type) {
732732
case core.NewMinedBlockEvent:
733-
self.BroadcastBlock(ev.Block, true) // First propagate block to peers
734-
self.BroadcastBlock(ev.Block, false) // Only then announce to the rest
733+
pm.BroadcastBlock(ev.Block, true) // First propagate block to peers
734+
pm.BroadcastBlock(ev.Block, false) // Only then announce to the rest
735735
}
736736
}
737737
}
738738

739-
func (self *ProtocolManager) txBroadcastLoop() {
739+
func (pm *ProtocolManager) txBroadcastLoop() {
740740
for {
741741
select {
742-
case event := <-self.txCh:
743-
self.BroadcastTx(event.Tx.Hash(), event.Tx)
742+
case event := <-pm.txCh:
743+
pm.BroadcastTx(event.Tx.Hash(), event.Tx)
744744

745745
// Err() channel will be closed when unsubscribing.
746-
case <-self.txSub.Err():
746+
case <-pm.txSub.Err():
747747
return
748748
}
749749
}
@@ -760,13 +760,13 @@ type NodeInfo struct {
760760
}
761761

762762
// NodeInfo retrieves some protocol metadata about the running host node.
763-
func (self *ProtocolManager) NodeInfo() *NodeInfo {
764-
currentBlock := self.blockchain.CurrentBlock()
763+
func (pm *ProtocolManager) NodeInfo() *NodeInfo {
764+
currentBlock := pm.blockchain.CurrentBlock()
765765
return &NodeInfo{
766-
Network: self.networkId,
767-
Difficulty: self.blockchain.GetTd(currentBlock.Hash(), currentBlock.NumberU64()),
768-
Genesis: self.blockchain.Genesis().Hash(),
769-
Config: self.blockchain.Config(),
766+
Network: pm.networkId,
767+
Difficulty: pm.blockchain.GetTd(currentBlock.Hash(), currentBlock.NumberU64()),
768+
Genesis: pm.blockchain.Genesis().Hash(),
769+
Config: pm.blockchain.Config(),
770770
Head: currentBlock.Hash(),
771771
}
772772
}

0 commit comments

Comments
 (0)