Fix some typos throughout repo.

This commit is contained in:
Olaoluwa Osuntokun 2014-09-08 14:19:47 -05:00 committed by Dave Collins
parent 790f652d06
commit b97083f882
10 changed files with 24 additions and 24 deletions

View file

@ -70,7 +70,7 @@ 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
@ -78,7 +78,7 @@ 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.
@ -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
@ -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*,
@ -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
@ -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[:]...)
@ -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.
@ -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()

View file

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

View file

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

View file

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

2
log.go
View file

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

View file

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

10
peer.go
View file

@ -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
@ -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
@ -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.
@ -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() {
@ -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() {

View file

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

View file

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

View file

@ -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" {
@ -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")