From ef9c50be578daf37559aeaed3ccc2a4b4cee1280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20B=C5=91sze?= Date: Mon, 22 Feb 2016 11:35:54 +0100 Subject: [PATCH] Fix typos in comments --- rpcserver.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index 38463727..acefdfba 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1018,7 +1018,7 @@ func handleGetAddedNodeInfo(s *rpcServer, cmd interface{}, closeChan <-chan stru c := cmd.(*btcjson.GetAddedNodeInfoCmd) // Retrieve a list of persistent (added) peers from the bitcoin server - // and filter the list of peer per the specified address (if any). + // and filter the list of peers per the specified address (if any). peers := s.server.AddedNodeInfo() if c.Node != nil { node := *c.Node @@ -1134,9 +1134,9 @@ func handleGetBestBlockHash(s *rpcServer, cmd interface{}, closeChan <-chan stru // minimum difficulty using the passed bits field from the header of a block. func getDifficultyRatio(bits uint32) float64 { // The minimum difficulty is the max possible proof-of-work limit bits - // converted back to a number. Note this is not the same as the the - // proof of work limit directly because the block difficulty is encoded - // in a block with the compact form which loses precision. + // converted back to a number. Note this is not the same as the proof of + // work limit directly because the block difficulty is encoded in a block + // with the compact form which loses precision. max := blockchain.CompactToBig(activeNetParams.PowLimitBits) target := blockchain.CompactToBig(bits) @@ -1481,10 +1481,10 @@ func (state *gbtWorkState) templateUpdateChan(prevHash *wire.ShaHash, lastGenera // updateBlockTemplate creates or updates a block template for the work state. // A new block template will be generated when the current best block has // changed or the transactions in the memory pool have been updated and it has -// been some time has passed since the last template was generated. Otherwise, -// the timestamp for the existing block template is updated (and possibly the +// been long enough since the last template was generated. Otherwise, the +// timestamp for the existing block template is updated (and possibly the // difficulty on testnet per the consesus rules). Finally, if the -// useCoinbaseValue flag is flase and the existing block template does not +// useCoinbaseValue flag is false and the existing block template does not // already contain a valid payment address, the block template will be updated // with a randomly selected payment address from the list of configured // addresses. @@ -1661,7 +1661,7 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld // depends on. This is necessary since the created block must // ensure proper ordering of the dependencies. A map is used // before creating the final array to prevent duplicate entries - // when mutiple inputs reference the same transaction. + // when multiple inputs reference the same transaction. dependsMap := make(map[int64]struct{}) for _, txIn := range tx.TxIn { if idx, ok := txIndex[txIn.PreviousOutPoint.Hash]; ok { @@ -1752,7 +1752,7 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld return &reply, nil } -// handleGetBlockTemplateLongPoll a helper for handleGetBlockTemplateRequest +// handleGetBlockTemplateLongPoll is a helper for handleGetBlockTemplateRequest // which deals with handling long polling for block templates. When a caller // sends a request with a long poll ID that was previously returned, a response // is not sent until the caller should stop working on the previous block @@ -1774,8 +1774,8 @@ func handleGetBlockTemplateLongPoll(s *rpcServer, longPollID string, useCoinbase return nil, err } - // Just return the current block template if the the long poll ID - // provided by the caller is invalid. + // Just return the current block template if the long poll ID provided by + // the caller is invalid. prevHash, lastGenerated, err := decodeTemplateID(longPollID) if err != nil { result, err := state.blockTemplateResult(useCoinbaseValue, nil) @@ -1812,8 +1812,8 @@ func handleGetBlockTemplateLongPoll(s *rpcServer, longPollID string, useCoinbase // Register the previous hash and last generated time for notifications // Get a channel that will be notified when the template associated with - // the provided ID is is stale and a new block template should be - // returned to the caller. + // the provided ID is stale and a new block template should be returned to + // the caller. longPollChan := state.templateUpdateChan(prevHash, lastGenerated) state.Unlock() @@ -2825,7 +2825,7 @@ func handleGetWorkRequest(s *rpcServer) (interface{}, error) { hash1[wire.HashSize] = 0x80 binary.BigEndian.PutUint64(hash1[len(hash1)-8:], wire.HashSize*8) - // The final result reverses the each of the fields to little endian. + // The final result reverses each of the fields to little endian. // In particular, the data, hash1, and midstate fields are treated as // arrays of uint32s (per the internal sha256 hashing state) which are // in big endian, and thus each 4 bytes is byte swapped. The target is