Skip to content

Commit

Permalink
Fix some typos throughout repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef authored and davecgh committed Sep 8, 2014
1 parent 790f652 commit b97083f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions addrmgr/addrmanager.go
Expand Up @@ -70,15 +70,15 @@ type localAddress struct {
score AddressPriority
}

// AddressPriority type is used to describe the heirarchy of local address
// AddressPriority type is used to describe the hierarchy of local address
// discovery methods.
type AddressPriority int

const (
// InterfacePrio signifies the address is on a local interface
InterfacePrio AddressPriority = iota

// BoundPrio signifies the address has been explicity bounded to.
// BoundPrio signifies the address has been explicitly bounded to.
BoundPrio

// UpnpPrio signifies the address was obtained from UPnP.
Expand Down Expand Up @@ -114,11 +114,11 @@ const (
// bucket.
newBucketSize = 64

// newBucketCount is the number of buckets taht we spread new addresses
// newBucketCount is the number of buckets that we spread new addresses
// over.
newBucketCount = 256

// triedBucketsPerGroup is the number of trieed buckets over which an
// triedBucketsPerGroup is the number of tried buckets over which an
// address group will be spread.
triedBucketsPerGroup = 4

Expand Down Expand Up @@ -171,7 +171,7 @@ func (a *AddrManager) updateAddress(netAddr, srcAddr *btcwire.NetAddress) {
addr := NetAddressKey(netAddr)
ka := a.find(netAddr)
if ka != nil {
// TODO(oga) only update adresses periodically.
// TODO(oga) only update addresses periodically.
// Update the last seen time and services.
// note that to prevent causing excess garbage on getaddr
// messages the netaddresses in addrmaanger are *immutable*,
Expand All @@ -198,7 +198,7 @@ func (a *AddrManager) updateAddress(netAddr, srcAddr *btcwire.NetAddress) {
}

// The more entries we have, the less likely we are to add more.
// likelyhood is 2N.
// likelihood is 2N.
factor := int32(2 * ka.refs)
if a.rand.Int31n(factor) != 0 {
return
Expand Down Expand Up @@ -294,7 +294,7 @@ func (a *AddrManager) pickTried(bucket int) *list.Element {

func (a *AddrManager) getNewBucket(netAddr, srcAddr *btcwire.NetAddress) int {
// bitcoind:
// doublesha256(key + sourcegroup + int64(doublesha256(key + group + sourcegroup))%bucket_per_source_group) % num_new_buckes
// doublesha256(key + sourcegroup + int64(doublesha256(key + group + sourcegroup))%bucket_per_source_group) % num_new_buckets

data1 := []byte{}
data1 = append(data1, a.key[:]...)
Expand Down Expand Up @@ -718,7 +718,7 @@ func (a *AddrManager) HostToNetAddress(host string, port uint16, services btcwir

// ipString returns a string for the ip from the provided NetAddress. If the
// ip is in the range used for tor addresses then it will be transformed into
// the relavent .onion address.
// the relevant .onion address.
func ipString(na *btcwire.NetAddress) string {
if IsOnionCatTor(na) {
// We know now that na.IP is long enogh.
Expand Down Expand Up @@ -865,7 +865,7 @@ func (a *AddrManager) Connected(addr *btcwire.NetAddress) {
}

// Good marks the given address as good. To be called after a successful
// connection and version exchange. If the address is unknown to the addresss
// connection and version exchange. If the address is unknown to the address
// manager it will be ignored.
func (a *AddrManager) Good(addr *btcwire.NetAddress) {
a.mtx.Lock()
Expand Down
2 changes: 1 addition & 1 deletion addrmgr/network.go
Expand Up @@ -12,7 +12,7 @@ import (
)

var (
// rfc1918Nets specifies the IPv4 private adddress blocks as defined by
// rfc1918Nets specifies the IPv4 private address blocks as defined by
// by RFC1918 (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16).
rfc1918Nets = []net.IPNet{
ipNet("10.0.0.0", 8, 32),
Expand Down
2 changes: 1 addition & 1 deletion blockmanager.go
Expand Up @@ -109,7 +109,7 @@ type processBlockResponse struct {

// processBlockMsg is a message type to be sent across the message channel
// for requested a block is processed. Note this call differs from blockMsg
// above in that blockMsg is intended for blocks that can from peers and have
// above in that blockMsg is intended for blocks that came from peers and have
// extra handling whereas this message essentially is just a concurrent safe
// way to call ProcessBlock on the internal block chain instance.
type processBlockMsg struct {
Expand Down
2 changes: 1 addition & 1 deletion config.go
Expand Up @@ -120,7 +120,7 @@ type serviceOptions struct {
ServiceCommand string `short:"s" long:"service" description:"Service command {install, remove, start, stop}"`
}

// cleanAndExpandPath expands environement variables and leading ~ in the
// cleanAndExpandPath expands environment variables and leading ~ in the
// passed path, cleans the result, and returns it.
func cleanAndExpandPath(path string) string {
// Expand initial ~ to OS specific home directory.
Expand Down
2 changes: 1 addition & 1 deletion log.go
Expand Up @@ -218,7 +218,7 @@ func formatLockTime(lockTime uint32) string {
return time.Unix(int64(lockTime), 0).String()
}

// invSummary returns an inventory messege as a human-readable string.
// invSummary returns an inventory message as a human-readable string.
func invSummary(invList []*btcwire.InvVect) string {
// No inventory.
invLen := len(invList)
Expand Down
2 changes: 1 addition & 1 deletion mining.go
Expand Up @@ -68,7 +68,7 @@ type txPrioItem struct {
}

// txPriorityQueueLessFunc describes a function that can be used as a compare
// function for a transation priority queue (txPriorityQueue).
// function for a transaction priority queue (txPriorityQueue).
type txPriorityQueueLessFunc func(*txPriorityQueue, int, int) bool

// txPriorityQueue implements a priority queue of txPrioItem elements that
Expand Down
10 changes: 5 additions & 5 deletions peer.go
Expand Up @@ -116,7 +116,7 @@ func newNetAddress(addr net.Addr, services btcwire.ServiceFlag) (*btcwire.NetAdd
}

// outMsg is used to house a message to be sent along with a channel to signal
// when the message has been sent (or won't be sent due to tings such as
// when the message has been sent (or won't be sent due to things such as
// shutdown)
type outMsg struct {
msg btcwire.Message
Expand All @@ -127,7 +127,7 @@ type outMsg struct {
// overall data flow is split into 3 goroutines and a separate block manager.
// Inbound messages are read via the inHandler goroutine and generally
// dispatched to their own handler. For inbound data-related messages such as
// blocks, transactions, and inventory, the data is pased on to the block
// blocks, transactions, and inventory, the data is passed on to the block
// manager to handle it. Outbound messages are queued via QueueMessage or
// QueueInventory. QueueMessage is intended for all messages, including
// responses to data such as blocks and transactions. QueueInventory, on the
Expand Down Expand Up @@ -527,7 +527,7 @@ func (p *peer) pushBlockMsg(sha *btcwire.ShaHash, doneChan, waitChan chan struct

// pushMerkleBlockMsg sends a merkleblock message for the provided block hash to
// the connected peer. Since a merkle block requires the peer to have a filter
// loaded, this call will simply be ignored if there is no filter laoded. An
// loaded, this call will simply be ignored if there is no filter loaded. An
// error is returned if the block hash is not known.
func (p *peer) pushMerkleBlockMsg(sha *btcwire.ShaHash, doneChan, waitChan chan struct{}) error {
// Do not send a response if the peer doesn't have a filter loaded.
Expand Down Expand Up @@ -1055,7 +1055,7 @@ func (p *peer) handleGetHeadersMsg(msg *btcwire.MsgGetHeaders) {

// handleFilterAddMsg is invoked when a peer receives a filteradd bitcoin
// message and is used by remote peers to add data to an already loaded bloom
// filter. The peer will be disonnected if a filter is not loaded when this
// filter. The peer will be disconnected if a filter is not loaded when this
// message is received.
func (p *peer) handleFilterAddMsg(msg *btcwire.MsgFilterAdd) {
if !p.filter.IsLoaded() {
Expand All @@ -1070,7 +1070,7 @@ func (p *peer) handleFilterAddMsg(msg *btcwire.MsgFilterAdd) {

// handleFilterClearMsg is invoked when a peer receives a filterclear bitcoin
// message and is used by remote peers to clear an already loaded bloom filter.
// The peer will be disonnected if a filter is not loaded when this message is
// The peer will be disconnected if a filter is not loaded when this message is
// received.
func (p *peer) handleFilterClearMsg(msg *btcwire.MsgFilterClear) {
if !p.filter.IsLoaded() {
Expand Down
4 changes: 2 additions & 2 deletions rpcwebsocket.go
Expand Up @@ -466,7 +466,7 @@ func (m *wsNotificationManager) UnregisterNewMempoolTxsUpdates(wsc *wsClient) {
m.queueNotification <- (*notificationUnregisterNewMempoolTxs)(wsc)
}

// notifyForNewTx notifies websocket clients that have registerd for updates
// notifyForNewTx notifies websocket clients that have registered for updates
// when a new transaction is added to the memory pool.
func (m *wsNotificationManager) notifyForNewTx(clients map[chan struct{}]*wsClient, tx *btcutil.Tx) {
txShaStr := tx.Sha().String()
Expand Down Expand Up @@ -821,7 +821,7 @@ func newWsNotificationManager(server *rpcServer) *wsNotificationManager {
}
}

// wsResponse houses a message to send to the a connected websocket client as
// wsResponse houses a message to send to a connected websocket client as
// well as a channel to reply on when the message is sent.
type wsResponse struct {
msg []byte
Expand Down
2 changes: 1 addition & 1 deletion server.go
Expand Up @@ -540,7 +540,7 @@ func (s *server) seedFromDNS() {

// peerHandler is used to handle peer operations such as adding and removing
// peers to and from the server, banning peers, and broadcasting messages to
// peers. It must be run a a goroutine.
// peers. It must be run in a goroutine.
func (s *server) peerHandler() {
// Start the address manager and block manager, both of which are needed
// by peers. This is done here since their lifecycle is closely tied
Expand Down
4 changes: 2 additions & 2 deletions upgrade.go
Expand Up @@ -61,7 +61,7 @@ func upgradeDBPathNet(oldDbPath, netName string) error {
}

// The new database name is based on the database type and
// resides in the a directory named after the network type.
// resides in a directory named after the network type.
newDbRoot := filepath.Join(filepath.Dir(cfg.DataDir), netName)
newDbName := blockDbNamePrefix + "_" + oldDbType
if oldDbType == "sqlite" {
Expand Down Expand Up @@ -91,7 +91,7 @@ func upgradeDBPaths() error {
// Prior to version 0.2.0, the databases were in the "db" directory and
// their names were suffixed by "testnet" and "regtest" for their
// respective networks. Check for the old database and update it to the
// new path introduced with version 0.2.0 accodingly.
// new path introduced with version 0.2.0 accordingly.
oldDbRoot := filepath.Join(oldBtcdHomeDir(), "db")
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd.db"), "mainnet")
upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_testnet.db"), "testnet")
Expand Down

0 comments on commit b97083f

Please sign in to comment.