Skip to content

Commit

Permalink
multi: Fix several misspellings in the comments.
Browse files Browse the repository at this point in the history
This commit corrects several typos in the comments found by misspell.
  • Loading branch information
davecgh committed Feb 25, 2016
1 parent ef9c50b commit eb882f3
Show file tree
Hide file tree
Showing 39 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion addrmgr/addrmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ func (a *AddrManager) Good(addr *wire.NetAddress) {
addrKey := NetAddressKey(addr)
oldBucket := -1
for i := range a.addrNew {
// we check for existance so we can record the first one
// we check for existence so we can record the first one
if _, ok := a.addrNew[i][addrKey]; ok {
delete(a.addrNew[i], addrKey)
ka.refs--
Expand Down
2 changes: 1 addition & 1 deletion addrmgr/addrmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/btcsuite/btcd/wire"
)

// naTest is used to describe a test to be perfomed against the NetAddressKey
// naTest is used to describe a test to be performed against the NetAddressKey
// method.
type naTest struct {
in wire.NetAddress
Expand Down
2 changes: 1 addition & 1 deletion blockchain/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestHaveBlock(t *testing.T) {
// Block 100000 should be present (as an orphan).
{hash: "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506", want: true},

// Random hashes should not be availble.
// Random hashes should not be available.
{hash: "123", want: false},
}

Expand Down
2 changes: 1 addition & 1 deletion blockchain/difficulty.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func BigToCompact(n *big.Int) uint32 {
// CalcWork calculates a work value from difficulty bits. Bitcoin increases
// the difficulty for generating a block by decreasing the value which the
// generated hash must be less than. This difficulty target is stored in each
// block header using a compact representation as described in the documenation
// block header using a compact representation as described in the documentation
// for CompactToBig. The main chain is selected by choosing the chain that has
// the most proof of work (highest difficulty). Since a lower target difficulty
// value equates to higher actual difficulty, the work value which will be
Expand Down
2 changes: 1 addition & 1 deletion blockchain/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TstTimeSorter(times []time.Time) sort.Interface {
var TstCheckSerializedHeight = checkSerializedHeight

// TstSetMaxMedianTimeEntries makes the ability to set the maximum number of
// median tiem entries available to the test package.
// median time entries available to the test package.
func TstSetMaxMedianTimeEntries(val int) {
maxMedianTimeEntries = val
}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func IsFinalizedTransaction(tx *btcutil.Tx, blockHeight int32, blockTime time.Ti
return true
}

// At this point, the transaction's lock time hasn't occured yet, but
// At this point, the transaction's lock time hasn't occurred yet, but
// the transaction might still be finalized if the sequence number
// for all transaction inputs is maxed out.
for _, txIn := range msgTx.TxIn {
Expand Down
4 changes: 2 additions & 2 deletions blockmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ func newBlockManager(s *server) (*blockManager, error) {
}
bmgrLog.Infof("Block index generation complete")

// Initialize the chain state now that the intial block node index has
// Initialize the chain state now that the initial block node index has
// been generated.
bm.updateChainState(newestHash, height)

Expand All @@ -1479,7 +1479,7 @@ func newBlockManager(s *server) (*blockManager, error) {
// removeRegressionDB removes the existing regression test database if running
// in regression test mode and it already exists.
func removeRegressionDB(dbPath string) error {
// Dont do anything if not in regression test mode.
// Don't do anything if not in regression test mode.
if !cfg.RegressionTest {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions btcec/ciphering.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func GenerateSharedSecret(privkey *PrivateKey, pubkey *PublicKey) []byte {
// HMAC [32]byte
// }
//
// The primary aim is to ensure byte compatibility with Pyelliptic. Additionaly,
// refer to section 5.8.1 of ANSI X9.63 for rationale on this format.
// The primary aim is to ensure byte compatibility with Pyelliptic. Also, refer
// to section 5.8.1 of ANSI X9.63 for rationale on this format.
func Encrypt(pubkey *PublicKey, in []byte) ([]byte, error) {
ephemeral, err := NewPrivateKey(S256())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion btcec/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package btcec
// 3) Since we're dealing with 32-bit values, 64-bits of overflow is a
// reasonable choice for #2
// 4) Given the need for 256-bits of precision and the properties stated in #1,
// #2, and #3, the representation which best accomodates this is 10 uint32s
// #2, and #3, the representation which best accommodates this is 10 uint32s
// with base 2^26 (26 bits * 10 = 260 bits, so the final word only needs 22
// bits) which leaves the desired 64 bits (32 * 10 = 320, 320 - 256 = 64) for
// overflow
Expand Down
2 changes: 1 addition & 1 deletion btcec/pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func isOdd(a *big.Int) bool {
// the solution to use.
func decompressPoint(curve *KoblitzCurve, x *big.Int, ybit bool) (*big.Int, error) {
// TODO(oga) This will probably only work for secp256k1 due to
// optimisations.
// optimizations.

// Y = +-sqrt(x^3 + B)
x3 := new(big.Int).Mul(x, x)
Expand Down
6 changes: 3 additions & 3 deletions btcjson/chainsvrresults.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ type GetNetTotalsResult struct {
TimeMillis int64 `json:"timemillis"`
}

// ScriptSig models a signature script. It is defined seperately since it only
// ScriptSig models a signature script. It is defined separately since it only
// applies to non-coinbase. Therefore the field in the Vin structure needs
// to be a pointer.
type ScriptSig struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
}

// Vin models parts of the tx data. It is defined seperately since
// Vin models parts of the tx data. It is defined separately since
// getrawtransaction, decoderawtransaction, and searchrawtransaction use the
// same structure.
type Vin struct {
Expand Down Expand Up @@ -322,7 +322,7 @@ func (v *VinPrevOut) MarshalJSON() ([]byte, error) {
return json.Marshal(txStruct)
}

// Vout models parts of the tx data. It is defined seperately since both
// Vout models parts of the tx data. It is defined separately since both
// getrawtransaction and decoderawtransaction use the same structure.
type Vout struct {
Value float64 `json:"value"`
Expand Down
2 changes: 1 addition & 1 deletion btcjson/cmdinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func subStructUsage(structType reflect.Type) string {
}

// Create the name/value entry for the field while considering
// the type of the field. Not all possibile types are covered
// the type of the field. Not all possible types are covered
// here and when one of the types not specifically covered is
// encountered, the field name is simply reused for the value.
fieldName := strings.ToLower(rtf.Name)
Expand Down
2 changes: 1 addition & 1 deletion btcjson/cmdinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/btcsuite/btcd/btcjson"
)

// TestCmdMethod tests the CmdMethod function to ensure it retuns the expected
// TestCmdMethod tests the CmdMethod function to ensure it retunrs the expected
// methods and errors.
func TestCmdMethod(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 1 addition & 1 deletion btcjson/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func TestRegisteredCmdMethods(t *testing.T) {
t.Fatal("RegisteredCmdMethods: no methods")
}

// Ensure the returnd methods are sorted.
// Ensure the returned methods are sorted.
sortedMethods := make([]string, len(methods))
copy(sortedMethods, methods)
sort.Sort(sort.StringSlice(sortedMethods))
Expand Down
4 changes: 2 additions & 2 deletions chainindexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const (
// When in "CatchUp" mode, incoming requests to index newly solved
// blocks are backed up for later processing. Once we've finished
// catching up, we process these queued jobs, and then enter into
// "maintainence" mode.
// "maintenance" mode.
indexCatchUp indexState = iota
// When in "maintainence" mode, we have a single worker serially
// When in "maintenance" mode, we have a single worker serially
// processing incoming jobs to index newly solved blocks.
indexMaintain
)
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func supportedSubsystems() []string {
subsystems = append(subsystems, subsysID)
}

// Sort the subsytems for stable display.
// Sort the subsystems for stable display.
sort.Strings(subsystems)
return subsystems
}
Expand Down
6 changes: 3 additions & 3 deletions database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Db interface {

// DropAfterBlockBySha will remove any blocks from the database after
// the given block. It terminates any existing transaction and performs
// its operations in an atomic transaction which is commited before
// its operations in an atomic transaction which is committed before
// the function returns.
DropAfterBlockBySha(*wire.ShaHash) (err error)

Expand Down Expand Up @@ -121,7 +121,7 @@ type Db interface {
// index information for a particular block height. Additionally, it
// will update the stored meta-data related to the curent tip of the
// addr index. These two operations are performed in an atomic
// transaction which is commited before the function returns.
// transaction which is committed before the function returns.
// Addresses are indexed by the raw bytes of their base58 decoded
// hash160.
UpdateAddrIndexForBlock(blkSha *wire.ShaHash, height int32,
Expand Down Expand Up @@ -194,7 +194,7 @@ func AddDBDriver(instance DriverDB) {
driverList = append(driverList, instance)
}

// CreateDB intializes and opens a database.
// CreateDB initializes and opens a database.
func CreateDB(dbtype string, args ...interface{}) (pbdb Db, err error) {
for _, drv := range driverList {
if drv.DbType == dbtype {
Expand Down
2 changes: 1 addition & 1 deletion database/ldb/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ func (db *LevelDb) FetchTxsForAddr(addr btcutil.Address, skip int,
// index information for a particular block height. Additionally, it
// will update the stored meta-data related to the curent tip of the
// addr index. These two operations are performed in an atomic
// transaction which is commited before the function returns.
// transaction which is committed before the function returns.
// Transactions indexed by address are stored with the following format:
// * prefix || hash160 || blockHeight || txoffset || txlen
// Indexes are stored purely in the key, with blank data for the actual value
Expand Down
2 changes: 1 addition & 1 deletion database2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ below.
Transactions
The Tx interface provides facilities for rolling back or commiting changes that
The Tx interface provides facilities for rolling back or committing changes that
took place while the transaction was active. It also provides the root metadata
bucket under which all keys, values, and nested buckets are stored. A
transaction can either be read-only or read-write and managed or unmanaged.
Expand Down
6 changes: 3 additions & 3 deletions database2/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func SupportedDrivers() []string {
return supportedDBs
}

// Create intializes and opens a database for the specified type. The arguments
// are specific to the database type driver. See the documentation for the
// database driver for further details.
// Create initializes and opens a database for the specified type. The
// arguments are specific to the database type driver. See the documentation
// for the database driver for further details.
//
// ErrDbUnknownType will be returned if the the database type is not registered.
func Create(dbType string, args ...interface{}) (DB, error) {
Expand Down
4 changes: 2 additions & 2 deletions database2/ffldb/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func testCursorInterface(tc *testContext, bucket database.Bucket) bool {
return false
}

// Ensure foward iteration works as expected after seeking.
// Ensure forward iteration works as expected after seeking.
middleIdx := (len(sortedValues) - 1) / 2
seekKey := sortedValues[middleIdx].key
curIdx = middleIdx
Expand Down Expand Up @@ -648,7 +648,7 @@ func testMetadataManualTxInterface(tc *testContext) bool {
//
// Otherwise, a read-write transaction is created, the values are
// written, standard bucket tests for read-write transactions are
// performed, and then the transaction is either commited or rolled
// performed, and then the transaction is either committed or rolled
// back depending on the flag.
bucket1Name := []byte("bucket1")
populateValues := func(writable, rollback bool, putValues []keyPair) bool {
Expand Down
2 changes: 1 addition & 1 deletion database2/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ type DB interface {
// Update invokes the passed function in the context of a managed
// read-write transaction. Any errors returned from the user-supplied
// function will cause the transaction to be rolled back and are
// returned from this function. Otherwise, the transaction is commited
// returned from this function. Otherwise, the transaction is committed
// when the user-supplied function returns a nil error.
//
// Calling Rollback or Commit on the transaction passed to the
Expand Down
2 changes: 1 addition & 1 deletion discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
)

// torLookupIP uses Tor to resolve DNS via the SOCKS extension they provide for
// resolution over the Tor network. Tor itself doesnt support ipv6 so this
// resolution over the Tor network. Tor itself doesn't support ipv6 so this
// doesn't either.
func torLookupIP(host, proxy string) ([]net.IP, error) {
conn, err := net.Dial("tcp", proxy)
Expand Down
2 changes: 1 addition & 1 deletion dynamicbanscore.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *dynamicBanScore) int(t time.Time) uint32 {

// increase increases the persistent, the decaying or both scores by the values
// passed as parameters. The resulting score is calculated as if the action was
// carried out at the point time represented by the third paramter. The
// carried out at the point time represented by the third parameter. The
// resulting score is returned.
//
// This function is not safe for concurrent access.
Expand Down
4 changes: 2 additions & 2 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
maxRejectReasonLen = 250
)

// Loggers per subsytem. Note that backendLog is a seelog logger that all of
// Loggers per subsystem. Note that backendLog is a seelog logger that all of
// the subsystem loggers route their messages to. When adding new subsystems,
// add a reference here, to the subsystemLoggers map, and the useLogger
// function.
Expand Down Expand Up @@ -136,7 +136,7 @@ func useLogger(subsystemID string, logger btclog.Logger) {
}

// initSeelogLogger initializes a new seelog logger that is used as the backend
// for all logging subsytems.
// for all logging subsystems.
func initSeelogLogger(logFile string) {
config := `
<seelog type="adaptive" mininterval="2000000" maxinterval="100000000"
Expand Down
2 changes: 1 addition & 1 deletion mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func (mp *txMemPool) FetchTransaction(txHash *wire.ShaHash) (*btcutil.Tx, error)

// FilterTransactionsByAddress returns all transactions currently in the
// mempool that either create an output to the passed address or spend a
// previously created ouput to the address.
// previously created output to the address.
func (mp *txMemPool) FilterTransactionsByAddress(addr btcutil.Address) ([]*btcutil.Tx, error) {
// Protect concurrent access.
mp.RLock()
Expand Down
2 changes: 1 addition & 1 deletion mempoolerror.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func errToRejectErr(err error) (wire.RejectCode, string) {
// Return a generic rejected string if there is no error. This really
// should not happen unless the code elsewhere is not setting an error
// as it should be, but it's best to be safe and simply return a generic
// string rather than allowing the following code that derferences the
// string rather than allowing the following code that dereferences the
// err to panic.
if err == nil {
return wire.RejectInvalid, "rejected"
Expand Down
4 changes: 2 additions & 2 deletions peer/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A quick overview of the major features peer provides are as follows:
- Full duplex reading and writing of bitcoin protocol messages
- Automatic handling of the initial handshake process including protocol
version negotiation
- Asynchronous message queueing of outbound messages with optional channel for
- Asynchronous message queuing of outbound messages with optional channel for
notification when the message is actually sent
- Flexible peer configuration
- Caller is responsible for creating outgoing connections and listening for
Expand Down Expand Up @@ -144,7 +144,7 @@ raw message bytes using a format similar to hexdump -C.
Bitcoin Improvement Proposals
This package supports all BIPS supported by the wire packge.
This package supports all BIPS supported by the wire package.
(https://godoc.org/github.com/btcsuite/btcd/wire#hdr-Bitcoin_Improvement_Proposals)
*/
package peer
16 changes: 8 additions & 8 deletions peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ type HostToNetAddrFunc func(host string, port uint16,
// communications via the peer-to-peer protocol. It provides full duplex
// reading and writing, automatic handling of the initial handshake process,
// querying of usage statistics and other information about the remote peer such
// as its address, user agent, and protocol version, output message queueing,
// as its address, user agent, and protocol version, output message queuing,
// inventory trickling, and the ability to dynamically register and unregister
// callbacks for handling bitcoin protocol messages.
//
Expand Down Expand Up @@ -1315,9 +1315,9 @@ out:

case sccReceiveMessage:
// Remove received messages from the expected
// reponse map. Since certain commands expect
// one of a group of responses, remove everyting
// in the expected group accordingly.
// response map. Since certain commands expect
// one of a group of responses, remove
// everything in the expected group accordingly.
switch msgCmd := msg.message.Command(); msgCmd {
case wire.CmdBlock:
fallthrough
Expand Down Expand Up @@ -1654,10 +1654,10 @@ out:
log.Tracef("Peer input handler done for %s", p)
}

// queueHandler handles the queueing of outgoing data for the peer. This runs
// as a muxer for various sources of input so we can ensure that server and
// peer handlers will not block on us sending a message.
// We then pass the data on to outHandler to be actually written.
// queueHandler handles the queuing of outgoing data for the peer. This runs as
// a muxer for various sources of input so we can ensure that server and peer
// handlers will not block on us sending a message. That data is then passed on
// to outHandler to be actually written.
func (p *Peer) queueHandler() {
pendingMsgs := list.New()
invSendQueue := list.New()
Expand Down
2 changes: 1 addition & 1 deletion policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func checkInputsStandard(tx *btcutil.Tx, txStore blockchain.TxStore) error {
return nil
}

// checkPkScriptStandard performs a series of checks on a transaction ouput
// checkPkScriptStandard performs a series of checks on a transaction output
// script (public key script) to ensure it is a "standard" public key script.
// A standard public key script is one that is a recognized form, and for
// multi-signature scripts, only contains from 1 to maxStandardMultiSigKeys
Expand Down
4 changes: 2 additions & 2 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ var rpcHandlersBeforeInit = map[string]commandHandler{
"verifymessage": handleVerifyMessage,
}

// list of commands that we recognise, but for which btcd has no support because
// list of commands that we recognize, but for which btcd has no support because
// it lacks support for wallet functionality. For these commands the user
// should ask a connected instance of btcwallet.
var rpcAskWallet = map[string]struct{}{
Expand Down Expand Up @@ -678,7 +678,7 @@ func stringInSlice(a string, list []string) bool {
// createVinList returns a slice of JSON objects for the inputs of the passed
// transaction.
func createVinListPrevOut(s *rpcServer, mtx *wire.MsgTx, chainParams *chaincfg.Params, vinExtra int, filterAddrMap map[string]struct{}) []btcjson.VinPrevOut {
// Use a dynamically sized list to accomodate the address filter.
// Use a dynamically sized list to accommodate the address filter.
vinList := make([]btcjson.VinPrevOut, 0, len(mtx.TxIn))

// Coinbase transactions only have a single txin by definition.
Expand Down
Loading

0 comments on commit eb882f3

Please sign in to comment.