swarm/swap: address @justelad's PR comments

This commit is contained in:
Fabio Barone 2018-11-14 09:48:26 -05:00
parent 0a7b7bd942
commit bacb6a4635
3 changed files with 4 additions and 7 deletions

View file

@ -734,7 +734,7 @@ func (c *clientParams) clientCreated() {
close(c.clientCreatedC)
}
//Return the streamer spec to callers
//GetSpec returns the streamer spec to callers
//This used to be a global variable but for simulations with
//multiple nodes its fields (notably the Hook) would be overwritten
func (r *Registry) GetSpec() *protocols.Spec {
@ -742,11 +742,10 @@ func (r *Registry) GetSpec() *protocols.Spec {
}
func (r *Registry) createSpec() {
// Spec is the spec of the streamer protocol
var spec = &protocols.Spec{
Name: "stream",
Version: 7,
Version: 8,
MaxMsgSize: 10 * 1024 * 1024,
Messages: []interface{}{
UnsubscribeMsg{},
@ -772,8 +771,6 @@ func (r *Registry) Protocols() []p2p.Protocol {
Version: r.spec.Version,
Length: r.spec.Length(),
Run: r.runProtocol,
// NodeInfo: ,
// PeerInfo: ,
},
}
}

View file

@ -69,7 +69,7 @@ func (s *Swap) Add(amount int64, peer *protocols.Peer) (err error) {
return err
}
//Get a peer's balance
//GetPeerBalance returns the balance for a given peer
func (swap *Swap) GetPeerBalance(peer enode.ID) (int64, error) {
swap.lock.RLock()
defer swap.lock.RUnlock()

View file

@ -1,4 +1,4 @@
// Copyreeeeight 2018 The go-ethereum Authors
// Copyright 2018 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify