From 95330bc1bb33eaf21dd850b99bb3d84bcfa03237 Mon Sep 17 00:00:00 2001 From: xiaoxiangxianzi <164908047+xiaoxiangxianzi@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:45:48 +0800 Subject: [PATCH] chore: fix some comments (#2146) Signed-off-by: xiaoxiangxianzi --- blockchain/chain.go | 2 +- btcutil/gcs/builder/builder.go | 2 +- btcutil/psbt/creator.go | 2 +- btcutil/psbt/utils.go | 2 +- mempool/mempool.go | 2 +- netsync/manager.go | 2 +- rpcwebsocket.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blockchain/chain.go b/blockchain/chain.go index c7e8b3c3..7e06e5c7 100644 --- a/blockchain/chain.go +++ b/blockchain/chain.go @@ -773,7 +773,7 @@ func (b *BlockChain) disconnectBlock(node *blockNode, block *btcutil.Block, view // Flush the cache on every disconnect. Since the code for // reorganization modifies the database directly, the cache // will be left in an inconsistent state if we don't flush it - // prior to the dbPutUtxoView that happends below. + // prior to the dbPutUtxoView that happens below. err = b.utxoCache.flush(dbTx, FlushRequired, state) if err != nil { return err diff --git a/btcutil/gcs/builder/builder.go b/btcutil/gcs/builder/builder.go index 4e952996..8e257b39 100644 --- a/btcutil/gcs/builder/builder.go +++ b/btcutil/gcs/builder/builder.go @@ -207,7 +207,7 @@ func (b *GCSBuilder) Build() (*gcs.Filter, error) { return nil, b.err } - // We'll ensure that all the paramaters we need to actually build the + // We'll ensure that all the parameters we need to actually build the // filter properly are set. if b.p == 0 { return nil, fmt.Errorf("p value is not set, cannot build") diff --git a/btcutil/psbt/creator.go b/btcutil/psbt/creator.go index a5f832e0..58b9a544 100644 --- a/btcutil/psbt/creator.go +++ b/btcutil/psbt/creator.go @@ -17,7 +17,7 @@ const MinTxVersion = 1 // within the unsigned transaction. The values of nLockTime, nSequence (per // input) and transaction version (must be 1 of 2) must be specified here. Note // that the default nSequence value is wire.MaxTxInSequenceNum. Referencing -// the PSBT BIP, this function serves the roles of teh Creator. +// the PSBT BIP, this function serves the roles of the Creator. func New(inputs []*wire.OutPoint, outputs []*wire.TxOut, version int32, nLockTime uint32, nSequences []uint32) (*Packet, error) { diff --git a/btcutil/psbt/utils.go b/btcutil/psbt/utils.go index 85bc82f5..0a900279 100644 --- a/btcutil/psbt/utils.go +++ b/btcutil/psbt/utils.go @@ -226,7 +226,7 @@ func serializeKVPairWithType(w io.Writer, kt uint8, keydata []byte, // getKey retrieves a single key - both the key type and the keydata (if // present) from the stream and returns the key type as an integer, or -1 if -// the key was of zero length. This integer is is used to indicate the presence +// the key was of zero length. This integer is used to indicate the presence // of a separator byte which indicates the end of a given key-value pair list, // and the keydata as a byte slice or nil if none is present. func getKey(r io.Reader) (int, []byte, error) { diff --git a/mempool/mempool.go b/mempool/mempool.go index db04f619..af3830ae 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -1635,7 +1635,7 @@ func (mp *TxPool) validateStandardness(tx *btcutil.Tx, nextBlockHeight int32, } // validateSigCost checks the cost to run the signature operations to make sure -// the number of singatures are sane. +// the number of signatures are sane. func (mp *TxPool) validateSigCost(tx *btcutil.Tx, utxoView *blockchain.UtxoViewpoint) error { diff --git a/netsync/manager.go b/netsync/manager.go index b1a4db4d..3215a86a 100644 --- a/netsync/manager.go +++ b/netsync/manager.go @@ -1136,7 +1136,7 @@ func (sm *SyncManager) haveInventory(invVect *wire.InvVect) (bool, error) { return false, nil } - // The requested inventory is is an unsupported type, so just claim + // The requested inventory is an unsupported type, so just claim // it is known to avoid requesting it. return true, nil } diff --git a/rpcwebsocket.go b/rpcwebsocket.go index 592ad1f3..02f59d58 100644 --- a/rpcwebsocket.go +++ b/rpcwebsocket.go @@ -228,7 +228,7 @@ func (m *wsNotificationManager) NotifyBlockDisconnected(block *btcutil.Block) { // NotifyMempoolTx passes a transaction accepted by mempool to the // notification manager for transaction notification processing. If -// isNew is true, the tx is is a new transaction, rather than one +// isNew is true, the tx is a new transaction, rather than one // added to the mempool during a reorg. func (m *wsNotificationManager) NotifyMempoolTx(tx *btcutil.Tx, isNew bool) { n := ¬ificationTxAcceptedByMempool{