Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
swap: removed logBalance helper function. A better way to handle logs…
Browse files Browse the repository at this point in the history
… and address errors is in the scope of issue #1601
  • Loading branch information
diegomasini authored and holisticode committed Aug 27, 2019
1 parent b6eeb71 commit 928437d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions swap/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ func (s *Swap) run(p *p2p.Peer, rw p2p.MsgReadWriter) error {
s.addPeer(swapPeer)
defer s.removePeer(swapPeer)

s.logBalance(protoPeer)

return swapPeer.Run(swapPeer.handleMsg)
}

Expand Down
10 changes: 0 additions & 10 deletions swap/swap.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,6 @@ func (s *Swap) loadBalance(peer enode.ID) (err error) {
return
}

// logBalance is a helper function to log the current balance of a peer
func (s *Swap) logBalance(peer *protocols.Peer) {
err := s.loadBalance(peer.ID())
if err != nil && err != state.ErrNotFound {
log.Error("error while loading balance for peer", "peer", peer.String())
} else {
log.Info("balance for peer", "peer", peer.ID(), "balance", s.balances[peer.ID()])
}
}

// sendCheque sends a cheque to peer
func (s *Swap) sendCheque(peer enode.ID) error {
swapPeer := s.getPeer(peer)
Expand Down

0 comments on commit 928437d

Please sign in to comment.