Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: Correct typos. #1864

Merged
merged 1 commit into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addrmgr/addrmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ const (
// addresses.
Ipv6Weak

// Ipv4 represents an IPV4 connection state between two addreses.
// Ipv4 represents an IPV4 connection state between two addresses.
Ipv4

// Ipv6Strong represents a connection state between two IPV6 addresses.
Expand Down
2 changes: 1 addition & 1 deletion bech32/bech32.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const charset = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
var gen = []int{0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3}

// toBytes converts each character in the string 'chars' to the value of the
// index of the correspoding character in 'charset'.
// index of the corresponding character in 'charset'.
func toBytes(chars string) ([]byte, error) {
decoded := make([]byte, 0, len(chars))
for i := 0; i < len(chars); i++ {
Expand Down
2 changes: 1 addition & 1 deletion bech32/bech32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestBech32(t *testing.T) {
str, encoded)
}

// Flip a bit in the string an make sure it is caught.
// Flip a bit in the string and make sure it is caught.
pos := strings.LastIndexAny(str, "1")
flipped := str[:pos+1] + string((str[pos+1] ^ 1)) + str[pos+2:]
_, _, err = Decode(flipped)
Expand Down
2 changes: 1 addition & 1 deletion blockchain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ func (b *BlockChain) connectBestChain(node *blockNode, block, parent *dcrutil.Bl
// and flush the status changes to the database. It is safe to
// ignore any errors when flushing here as the changes will be
// flushed when a valid block is connected, and the worst case
// scenario if a block a invalid is it would need to be
// scenario if a block is invalid is it would need to be
// revalidated after a restart.
view := NewUtxoViewpoint()
view.SetBestHash(parentHash)
Expand Down
4 changes: 2 additions & 2 deletions blockchain/chainio.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func decodeSpentTxOut(serialized []byte, stxo *spentTxOut, amount int64, height
// Since the serialization format is not self describing, as noted in the
// format comments, this function also requires the transactions that spend the
// txouts and a utxo view that contains any remaining existing utxos in the
// transactions referenced by the inputs to the passed transasctions.
// transactions referenced by the inputs to the passed transactions.
func deserializeSpendJournalEntry(serialized []byte, txns []*wire.MsgTx) ([]spentTxOut, error) {
// Calculate the total number of stxos.
var numStxos int
Expand Down Expand Up @@ -1659,7 +1659,7 @@ func (b *BlockChain) initChainState() error {

// Determine how many blocks will be loaded into the index in order to
// allocate the right amount as a single alloc versus a whole bunch of
// littles ones to reduce pressure on the GC.
// little ones to reduce pressure on the GC.
blockIndexBucket := meta.Bucket(dbnamespace.BlockIndexBucketName)
var blockCount int32
cursor := blockIndexBucket.Cursor()
Expand Down
2 changes: 1 addition & 1 deletion blockchain/chainio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestErrNotInMainChain(t *testing.T) {

// Ensure the stringized output for the error is as expected.
if err.Error() != errStr {
t.Fatalf("errNotInMainChain retuned unexpected error string - "+
t.Fatalf("errNotInMainChain returned unexpected error string - "+
"got %q, want %q", err.Error(), errStr)
}

Expand Down
2 changes: 1 addition & 1 deletion blockchain/chainview.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (c *chainView) next(node *blockNode) *blockNode {
}

// Next returns the successor to the provided node for the chain view. It will
// return nil if there is no successfor or the provided node is not part of the
// return nil if there is no successor or the provided node is not part of the
// view.
//
// For example, assume a block chain with a side chain as depicted below:
Expand Down
2 changes: 1 addition & 1 deletion blockchain/difficulty.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ func calcNextStakeDiffV2(params *chaincfg.Params, nextHeight, curDiff, prevPoolS
// Calculate the difficulty by multiplying the old stake difficulty
// with two ratios that represent a force to counteract the relative
// change in the pool size (Fc) and a restorative force to push the pool
// size towards the target value (Fr).
// size towards the target value (Fr).
//
// Per DCP0001, the generalized equation is:
//
Expand Down
2 changes: 1 addition & 1 deletion blockchain/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func (e RuleError) Error() string {
return e.Description
}

// ruleError creates an RuleError given a set of arguments.
// ruleError creates a RuleError given a set of arguments.
func ruleError(c ErrorCode, desc string) RuleError {
return RuleError{ErrorCode: c, Description: desc}
}
2 changes: 1 addition & 1 deletion blockchain/indexers/addrindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (b *addrIndexBucket) sanityCheck(addrKey [addrKeySize]byte, expectedTotal i
var totalEntries int
maxEntries := level0MaxEntries
for level := uint8(0); level <= highestLevel; level++ {
// Level 0 can'have more entries than the max allowed if the
// Level 0 can't have more entries than the max allowed if the
// levels after it have data and it can't be empty. All other
// levels must either be half full or full.
data := b.levels[keyForLevel(addrKey, level)]
Expand Down
2 changes: 1 addition & 1 deletion blockchain/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
// It should be noted that the block might still ultimately fail to
// become the new main chain tip if it contains invalid scripts, double
// spends, etc. However, this is quite rare in practice because a lot
// of work was expended to create a block which satisifies the proof of
// of work was expended to create a block which satisfies the proof of
// work requirement.
//
// Finally, this notification is only sent if the chain is believed
Expand Down
2 changes: 1 addition & 1 deletion blockchain/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (b *BlockChain) processOrphans(hash *chainhash.Hash, flags BehaviorFlags) e
// the best chain or is now the tip of the best chain due to causing a
// reorganize, the fork length will be 0. The second return value indicates
// whether or not the block is an orphan, in which case the fork length will
// also be zero as expected, because it, by definition, does not connect ot the
// also be zero as expected, because it, by definition, does not connect to the
// best chain.
//
// This function is safe for concurrent access.
Expand Down
2 changes: 1 addition & 1 deletion blockchain/stake/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (e RuleError) GetCode() ErrorCode {
return e.ErrorCode
}

// stakeRuleError creates an RuleError given a set of arguments.
// stakeRuleError creates a RuleError given a set of arguments.
func stakeRuleError(c ErrorCode, desc string) RuleError {
return RuleError{ErrorCode: c, Description: desc}
}
2 changes: 1 addition & 1 deletion blockchain/stake/internal/ticketdb/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (e ErrorCode) String() string {
return fmt.Sprintf("Unknown ErrorCode (%d)", int(e))
}

// DBError identifies a an error in the stake database for tickets.
// DBError identifies an error in the stake database for tickets.
// The caller can use type assertions to determine if a failure was
// specifically due to a rule violation and access the ErrorCode field to
// ascertain the specific reason for the rule violation.
Expand Down
2 changes: 1 addition & 1 deletion blockchain/stake/internal/tickettreap/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (s *parentStack) Push(node *treapNode) {
// This approach is used over append because reslicing the slice to pop
// the item causes the compiler to make unneeded allocations. Also,
// since the max number of items is related to the tree depth which
// requires expontentially more items to increase, only increase the cap
// requires exponentially more items to increase, only increase the cap
// one item at a time. This is more intelligent than the generic append
// expansion algorithm which often doubles the cap.
index := s.index - staticDepth
Expand Down
2 changes: 1 addition & 1 deletion blockchain/stake/internal/tickettreap/immutable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func TestImmutableReverseSequential(t *testing.T) {
}

// TestImmutableUnordered ensures that putting keys into an immutable treap in
// no paritcular order works as expected.
// no particular order works as expected.
func TestImmutableUnordered(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 2 additions & 2 deletions blockchain/stake/staketx.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ func CheckSSGen(tx *wire.MsgTx) error {
}

// IsSSGen returns whether or not a transaction is a stake submission generation
// transaction. There are also known as votes.
// transaction. These are also known as votes.
func IsSSGen(tx *wire.MsgTx) bool {
return CheckSSGen(tx) == nil
}
Expand Down Expand Up @@ -937,7 +937,7 @@ func CheckSSRtx(tx *wire.MsgTx) error {
}

// IsSSRtx returns whether or not a transaction is a stake submission revocation
// transaction. There are also known as revocations.
// transaction. These are also known as revocations.
func IsSSRtx(tx *wire.MsgTx) bool {
return CheckSSRtx(tx) == nil
}
Expand Down
2 changes: 1 addition & 1 deletion blockchain/stake/tickets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func TestTicketDBLongChain(t *testing.T) {
filename := filepath.Join("testdata", "testexpiry.bz2")
fi, err := os.Open(filename)
if err != nil {
t.Fatalf("failed ot open test data: %v", err)
t.Fatalf("failed to open test data: %v", err)
}
bcStream := bzip2.NewReader(fi)
defer fi.Close()
Expand Down
2 changes: 1 addition & 1 deletion blockchain/thresholdstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ func (b *BlockChain) StateLastChangedHeight(hash *chainhash.Hash, version uint32
return 0, HashError(hash.String())
}

// Fetch the treshold state cache for the provided deployment id as well as
// Fetch the threshold state cache for the provided deployment id as well as
// the condition checker.
var cache *thresholdStateCache
var checker thresholdConditionChecker
Expand Down
30 changes: 15 additions & 15 deletions blockchain/thresholdstate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func TestThresholdState(t *testing.T) {
// version 3.
//
// This will result in triggering enforcement of the stake version and
// that the stake version is 3. The treshold state for the test dummy
// that the stake version is 3. The threshold state for the test dummy
// deployments must still be defined since a v4 majority proof-of-work
// and proof-of-stake upgrade are required before moving to started.
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -308,7 +308,7 @@ func TestThresholdState(t *testing.T) {
//
// This will result in achieving stake version 4 enforcement.
//
// The treshold state for the dummy deployments must still be defined
// The threshold state for the dummy deployments must still be defined
// since it can only change on a rule change boundary and it still
// requires a v4 majority proof-of-work upgrade before moving to
// started.
Expand Down Expand Up @@ -338,7 +338,7 @@ func TestThresholdState(t *testing.T) {
// the final two blocks to block version 4 so that majority version 4
// is not achieved, but the final block in the interval is version 4.
//
// The treshold state for the dummy deployments must still be defined
// The threshold state for the dummy deployments must still be defined
// since it still requires a v4 majority proof-of-work upgrade before
// moving to started.
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -375,7 +375,7 @@ func TestThresholdState(t *testing.T) {
// achieved and this will achieve v4 majority proof-of-work upgrade,
// voting can begin at the next rule change interval.
//
// The treshold state for the dummy deployments must still be defined
// The threshold state for the dummy deployments must still be defined
// since even though all required upgrade conditions are met, the state
// change must not happen until the start of the next rule change
// interval.
Expand Down Expand Up @@ -405,7 +405,7 @@ func TestThresholdState(t *testing.T) {
// vote bits to include yes votes for the first test dummy agenda and
// no for the second test dummy agenda to ensure they aren't counted.
//
// The treshold state for the dummy deployments must move to started.
// The threshold state for the dummy deployments must move to started.
// Even though the majority of the votes have already been voting yes
// for the first test dummy agenda, and no for the second one, they must
// not count, otherwise it would move straight to lockedin or failed,
Expand Down Expand Up @@ -437,7 +437,7 @@ func TestThresholdState(t *testing.T) {
// vote bits to include yes votes for the first test dummy agenda and
// no for the second test dummy agenda to ensure they aren't counted.
//
// The treshold state for the dummy deployments must remain in started
// The threshold state for the dummy deployments must remain in started
// because the votes are an old version and thus have a different
// definition and don't apply to version 4.
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -468,7 +468,7 @@ func TestThresholdState(t *testing.T) {
// votes for the first test dummy agenda and a majority no for the
// second test dummy agenda.
//
// The treshold state for the dummy deployments must remain in started
// The threshold state for the dummy deployments must remain in started
// because quorum was not reached.
// ---------------------------------------------------------------------

Expand Down Expand Up @@ -504,7 +504,7 @@ func TestThresholdState(t *testing.T) {
// majority yes for the first test dummy agenda and a few votes shy of a
// majority no for the second test dummy agenda.
//
// The treshold state for the dummy deployments must remain in started
// The threshold state for the dummy deployments must remain in started
// because even though quorum was reached, a required majority was not.
// ---------------------------------------------------------------------

Expand Down Expand Up @@ -547,7 +547,7 @@ func TestThresholdState(t *testing.T) {
// vote bits to yes for the first test dummy agenda and no to the second
// one.
//
// The treshold state for the first dummy deployment must move to
// The threshold state for the first dummy deployment must move to
// lockedin since a majority yes vote was achieved while the second
// dummy deployment must move to failed since a majority no vote was
// achieved.
Expand Down Expand Up @@ -578,12 +578,12 @@ func TestThresholdState(t *testing.T) {
// vote bits to include no votes for the first test dummy agenda and
// yes votes for the second one.
//
// The treshold state for the first dummy deployment must move to active
// since even though the interval had a majority no votes, lockedin
// status has already been achieved and can't be undone without a new
// agenda. Similarly, the second one must remain in failed even though
// the interval had a majority yes votes since a failed state can't be
// undone.
// The threshold state for the first dummy deployment must move to
// active since even though the interval had a majority no votes,
// lockedin status has already been achieved and can't be undone without
// a new agenda. Similarly, the second one must remain in failed even
// though the interval had a majority yes votes since a failed state
// can't be undone.
// ---------------------------------------------------------------------

blocksNeeded = stakeValidationHeight + ruleChangeInterval*8 - 1 -
Expand Down
6 changes: 3 additions & 3 deletions blockchain/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ func isStakeScriptHash(script []byte, stakeOpcode byte) bool {
}

// isAllowedTicketInputScriptForm returns whether or not the passed public key
// script is a one of the allowed forms for a ticket input.
// script is one of the allowed forms for a ticket input.
func isAllowedTicketInputScriptForm(script []byte) bool {
return isPubKeyHash(script) || isScriptHash(script) ||
isStakePubKeyHash(script, txscript.OP_SSGEN) ||
Expand Down Expand Up @@ -1726,7 +1726,7 @@ func checkTicketRedeemerCommitments(ticketHash *chainhash.Hash, ticketOuts []*st
}
contributionSumBig := big.NewInt(contributionSum)

// The outputs that satisify the commitments of the ticket start at offset
// The outputs that satisfy the commitments of the ticket start at offset
// 2 for votes while they start at 0 for revocations. Also, the payments
// must be tagged with the appropriate stake opcode depending on whether it
// is a vote or a revocation. Finally, the fee limits in the original
Expand Down Expand Up @@ -1908,7 +1908,7 @@ func checkVoteInputs(subsidyCache *standalone.SubsidyCache, tx *dcrutil.Tx, txHe
ticketHash := &ticketIn.PreviousOutPoint.Hash
ticketUtxo := view.LookupEntry(ticketHash)
if ticketUtxo == nil || ticketUtxo.IsFullySpent() {
str := fmt.Sprintf("ticket output %v referenced by vote %s:%d either "+
str := fmt.Sprintf("ticket output %v referenced by vote %s:%d either "+
"does not exist or has already been spent",
ticketIn.PreviousOutPoint, voteHash, ticketInIdx)
return ruleError(ErrMissingTxOut, str)
Expand Down
2 changes: 1 addition & 1 deletion blockchain/votebits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var (
},
{
Id: "Vote against",
Description: "Vote against all multiple ",
Description: "Vote against all multiple",
Bits: 0x20, // 0b0010 0000
IsAbstain: false,
IsNo: true,
Expand Down
10 changes: 5 additions & 5 deletions blockmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ type blockManagerConfig struct {
TxMemPool *mempool.TxPool
BgBlkTmplGenerator *BgBlkTmplGenerator

// The following fields are blockManger callbacks.
// The following fields are blockManager callbacks.
NotifyWinningTickets func(*WinningTicketsNtfnData)
PruneRebroadcastInventory func()
RpcServer func() *rpcServer
Expand Down Expand Up @@ -468,7 +468,7 @@ func (b *blockManager) startSync(peers *list.List) {

// Remove sync candidate peers that are no longer candidates due
// to passing their latest known block. NOTE: The < is
// intentional as opposed to <=. While techcnically the peer
// intentional as opposed to <=. While technically the peer
// doesn't have a later block when it's equal, it will likely
// have one soon so it is a reasonable choice. It also allows
// the case where both are at 0 such as during regression test.
Expand Down Expand Up @@ -1065,7 +1065,7 @@ func (b *blockManager) handleBlockMsg(bmsg *blockMsg) {
b.cfg.TxMemPool.PruneExpiredTx()

// Update this peer's latest block height, for future
// potential sync node candidancy.
// potential sync node candidacy.
heightUpdate = best.Height
blkHashUpdate = &best.Hash

Expand Down Expand Up @@ -1223,7 +1223,7 @@ func (b *blockManager) handleHeadersMsg(hmsg *headersMsg) {
prevNodeEl := b.headerList.Back()
if prevNodeEl == nil {
bmgrLog.Warnf("Header list does not contain a previous" +
"element as expected -- disconnecting peer")
" element as expected -- disconnecting peer")
hmsg.peer.Disconnect()
return
}
Expand Down Expand Up @@ -1889,7 +1889,7 @@ func (b *blockManager) handleBlockchainNotification(notification *blockchain.Not
// TODO: In the case the new tip disapproves the previous block, any
// transactions the previous block contains in its regular tree which
// double spend the same inputs as transactions in either tree of the
// current tip should ideally be tracked in the pool as eligibile for
// current tip should ideally be tracked in the pool as eligible for
// inclusion in an alternative tip (side chain block) in case the
// current tip block does not get enough votes. However, the
// transaction pool currently does not provide any way to distinguish
Expand Down
2 changes: 1 addition & 1 deletion chaincfg/chainec/edwards.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (e edwardsDSA) Decrypt(privkey []byte, in []byte) ([]byte,
return e.decrypt(privkey, in)
}

// newEdwardsDSA instatiates a function DSA subsystem over the edwards 25519
// newEdwardsDSA instantiates a function DSA subsystem over the edwards 25519
// curve. A caveat for the functions below is that they're all routed through
// interfaces, and nil returns from the library itself for interfaces must
// ALWAYS be checked by checking the return value by attempted dereference
Expand Down
2 changes: 1 addition & 1 deletion chaincfg/chainec/secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (sp secp256k1DSA) Decrypt(privkey []byte, in []byte) ([]byte,
return sp.decrypt(privkey, in)
}

// newSecp256k1DSA instatiates a function DSA subsystem over the secp256k1
// newSecp256k1DSA instantiates a function DSA subsystem over the secp256k1
// curve. A caveat for the functions below is that they're all routed through
// interfaces, and nil returns from the library itself for interfaces must
// ALWAYS be checked by checking the return value by attempted dereference
Expand Down
2 changes: 1 addition & 1 deletion chaincfg/chainec/secschnorr.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (sp secSchnorrDSA) Decrypt(privkey []byte, in []byte) ([]byte,
return sp.decrypt(privkey, in)
}

// newSecSchnorrDSA instatiates a function DSA subsystem over the secp256k1
// newSecSchnorrDSA instantiates a function DSA subsystem over the secp256k1
// curve. A caveat for the functions below is that they're all routed through
// interfaces, and nil returns from the library itself for interfaces must
// ALWAYS be checked by checking the return value by attempted dereference
Expand Down
Loading