From eb882f39f8b263777bfefba06d44b69230d46a53 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 25 Feb 2016 11:17:12 -0600 Subject: [PATCH] multi: Fix several misspellings in the comments. This commit corrects several typos in the comments found by misspell. --- addrmgr/addrmanager.go | 2 +- addrmgr/addrmanager_test.go | 2 +- blockchain/chain_test.go | 2 +- blockchain/difficulty.go | 2 +- blockchain/internal_test.go | 2 +- blockchain/validate.go | 2 +- blockmanager.go | 4 ++-- btcec/ciphering.go | 4 ++-- btcec/field.go | 2 +- btcec/pubkey.go | 2 +- btcjson/chainsvrresults.go | 6 +++--- btcjson/cmdinfo.go | 2 +- btcjson/cmdinfo_test.go | 2 +- btcjson/register_test.go | 2 +- chainindexer.go | 4 ++-- config.go | 2 +- database/db.go | 6 +++--- database/ldb/tx.go | 2 +- database2/doc.go | 2 +- database2/driver.go | 6 +++--- database2/ffldb/interface_test.go | 4 ++-- database2/interface.go | 2 +- discovery.go | 2 +- dynamicbanscore.go | 2 +- log.go | 4 ++-- mempool.go | 2 +- mempoolerror.go | 2 +- peer/doc.go | 4 ++-- peer/peer.go | 16 ++++++++-------- policy.go | 2 +- rpcserver.go | 4 ++-- rpcwebsocket.go | 18 +++++++++--------- server.go | 8 ++++---- txscript/engine.go | 2 +- txscript/error.go | 2 +- txscript/script.go | 2 +- txscript/scriptbuilder.go | 2 +- txscript/sign.go | 4 ++-- wire/fixedIO_test.go | 2 +- 39 files changed, 71 insertions(+), 71 deletions(-) diff --git a/addrmgr/addrmanager.go b/addrmgr/addrmanager.go index c2d03a50..9ac32188 100644 --- a/addrmgr/addrmanager.go +++ b/addrmgr/addrmanager.go @@ -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-- diff --git a/addrmgr/addrmanager_test.go b/addrmgr/addrmanager_test.go index a6d2fb92..3442d360 100644 --- a/addrmgr/addrmanager_test.go +++ b/addrmgr/addrmanager_test.go @@ -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 diff --git a/blockchain/chain_test.go b/blockchain/chain_test.go index 12af89a5..0cf9090e 100644 --- a/blockchain/chain_test.go +++ b/blockchain/chain_test.go @@ -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}, } diff --git a/blockchain/difficulty.go b/blockchain/difficulty.go index c922df9b..21c51800 100644 --- a/blockchain/difficulty.go +++ b/blockchain/difficulty.go @@ -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 diff --git a/blockchain/internal_test.go b/blockchain/internal_test.go index e31b03fd..af4df27e 100644 --- a/blockchain/internal_test.go +++ b/blockchain/internal_test.go @@ -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 } diff --git a/blockchain/validate.go b/blockchain/validate.go index c32fc194..f835a3ab 100644 --- a/blockchain/validate.go +++ b/blockchain/validate.go @@ -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 { diff --git a/blockmanager.go b/blockmanager.go index 3a119bc0..d7bf6d1f 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -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) @@ -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 } diff --git a/btcec/ciphering.go b/btcec/ciphering.go index d1a6db2a..e4f3abeb 100644 --- a/btcec/ciphering.go +++ b/btcec/ciphering.go @@ -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 { diff --git a/btcec/field.go b/btcec/field.go index 6e1d176a..2a74878b 100644 --- a/btcec/field.go +++ b/btcec/field.go @@ -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 diff --git a/btcec/pubkey.go b/btcec/pubkey.go index d8b06bfd..e05092d1 100644 --- a/btcec/pubkey.go +++ b/btcec/pubkey.go @@ -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) diff --git a/btcjson/chainsvrresults.go b/btcjson/chainsvrresults.go index 29d4c096..56728429 100644 --- a/btcjson/chainsvrresults.go +++ b/btcjson/chainsvrresults.go @@ -221,7 +221,7 @@ 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 { @@ -229,7 +229,7 @@ type ScriptSig struct { 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 { @@ -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"` diff --git a/btcjson/cmdinfo.go b/btcjson/cmdinfo.go index 6fe4f9f7..1e78e286 100644 --- a/btcjson/cmdinfo.go +++ b/btcjson/cmdinfo.go @@ -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) diff --git a/btcjson/cmdinfo_test.go b/btcjson/cmdinfo_test.go index d2b14774..b3336e64 100644 --- a/btcjson/cmdinfo_test.go +++ b/btcjson/cmdinfo_test.go @@ -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() diff --git a/btcjson/register_test.go b/btcjson/register_test.go index 34c97124..4cac9c7a 100644 --- a/btcjson/register_test.go +++ b/btcjson/register_test.go @@ -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)) diff --git a/chainindexer.go b/chainindexer.go index d33dee44..b4844a19 100644 --- a/chainindexer.go +++ b/chainindexer.go @@ -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 ) diff --git a/config.go b/config.go index 1e5e221a..93bce32c 100644 --- a/config.go +++ b/config.go @@ -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 } diff --git a/database/db.go b/database/db.go index 89ca5320..0cac413e 100644 --- a/database/db.go +++ b/database/db.go @@ -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) @@ -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, @@ -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 { diff --git a/database/ldb/tx.go b/database/ldb/tx.go index 87d3a62f..01ee82de 100644 --- a/database/ldb/tx.go +++ b/database/ldb/tx.go @@ -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 diff --git a/database2/doc.go b/database2/doc.go index 5d8dd17f..8ba322ec 100644 --- a/database2/doc.go +++ b/database2/doc.go @@ -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. diff --git a/database2/driver.go b/database2/driver.go index b71e0c1d..e306077b 100644 --- a/database2/driver.go +++ b/database2/driver.go @@ -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) { diff --git a/database2/ffldb/interface_test.go b/database2/ffldb/interface_test.go index 125fd7c7..c15b49b1 100644 --- a/database2/ffldb/interface_test.go +++ b/database2/ffldb/interface_test.go @@ -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 @@ -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 { diff --git a/database2/interface.go b/database2/interface.go index 417b9631..08fa8d8d 100644 --- a/database2/interface.go +++ b/database2/interface.go @@ -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 diff --git a/discovery.go b/discovery.go index 2117c45d..44c58f78 100644 --- a/discovery.go +++ b/discovery.go @@ -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) diff --git a/dynamicbanscore.go b/dynamicbanscore.go index c098ae95..786c7b40 100644 --- a/dynamicbanscore.go +++ b/dynamicbanscore.go @@ -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. diff --git a/log.go b/log.go index 54b26e37..8527932c 100644 --- a/log.go +++ b/log.go @@ -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. @@ -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 := ` 0 && diff --git a/txscript/scriptbuilder.go b/txscript/scriptbuilder.go index bf5e91f7..6c8f641e 100644 --- a/txscript/scriptbuilder.go +++ b/txscript/scriptbuilder.go @@ -237,7 +237,7 @@ func (b *ScriptBuilder) Reset() *ScriptBuilder { return b } -// Script returns the currently built script. When any errors occured while +// Script returns the currently built script. When any errors occurred while // building the script, the script will be returned up the point of the first // error along with the error. func (b *ScriptBuilder) Script() ([]byte, error) { diff --git a/txscript/sign.go b/txscript/sign.go index b2082be3..e810bd0c 100644 --- a/txscript/sign.go +++ b/txscript/sign.go @@ -211,7 +211,7 @@ func mergeScripts(chainParams *chaincfg.Params, tx *wire.MsgTx, idx int, return mergeMultiSig(tx, idx, addresses, nRequired, pkScript, sigScript, prevScript) - // It doesn't actualy make sense to merge anything other than multiig + // It doesn't actually make sense to merge anything other than multiig // and scripthash (because it could contain multisig). Everything else // has either zero signature, can't be spent, or has a single signature // which is either present or not. The other two cases are handled @@ -374,7 +374,7 @@ func (sc ScriptClosure) GetScript(address btcutil.Address) ([]byte, error) { // looked up by calling getKey() with the string of the given address. // Any pay-to-script-hash signatures will be similarly looked up by calling // getScript. If previousScript is provided then the results in previousScript -// will be merged in a type-dependant manner with the newly generated. +// will be merged in a type-dependent manner with the newly generated. // signature script. func SignTxOutput(chainParams *chaincfg.Params, tx *wire.MsgTx, idx int, pkScript []byte, hashType SigHashType, kdb KeyDB, sdb ScriptDB, diff --git a/wire/fixedIO_test.go b/wire/fixedIO_test.go index 77811f96..f9377f0a 100644 --- a/wire/fixedIO_test.go +++ b/wire/fixedIO_test.go @@ -31,7 +31,7 @@ func (w *fixedWriter) Write(p []byte) (n int, err error) { return } -// Bytes returns the bytes alreayd written to the fixed writer. +// Bytes returns the bytes already written to the fixed writer. func (w *fixedWriter) Bytes() []byte { return w.b }