@@ -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