Typo corrections in various comments

This commit is contained in:
AdamISZ 2019-05-10 17:14:19 +02:00
parent fb1819bf7f
commit 6e054886d8
5 changed files with 24 additions and 24 deletions

@ -400,7 +400,7 @@ type OpenChannel struct {
ChainHash chainhash.Hash ChainHash chainhash.Hash
// FundingOutpoint is the outpoint of the final funding transaction. // FundingOutpoint is the outpoint of the final funding transaction.
// This value uniquely and globally identities the channel within the // This value uniquely and globally identifies the channel within the
// target blockchain as specified by the chain hash parameter. // target blockchain as specified by the chain hash parameter.
FundingOutpoint wire.OutPoint FundingOutpoint wire.OutPoint
@ -1049,8 +1049,8 @@ func (c *OpenChannel) UpdateCommitment(newCommitment *ChannelCommitment) error {
return fmt.Errorf("unable to store chan info: %v", err) return fmt.Errorf("unable to store chan info: %v", err)
} }
// With the proper bucket fetched, we'll now write toe latest // With the proper bucket fetched, we'll now write the latest
// commitment state to dis for the target party. // commitment state to disk for the target party.
err = putChanCommitment( err = putChanCommitment(
chanBucket, newCommitment, true, chanBucket, newCommitment, true,
) )
@ -1459,7 +1459,7 @@ func (c *OpenChannel) AppendRemoteCommitChain(diff *CommitDiff) error {
defer c.Unlock() defer c.Unlock()
// If this is a restored channel, then we want to avoid mutating the // If this is a restored channel, then we want to avoid mutating the
// state as all, as it's impossible to do so in a protocol compliant // state at all, as it's impossible to do so in a protocol compliant
// manner. // manner.
if c.hasChanStatus(ChanStatusRestored) { if c.hasChanStatus(ChanStatusRestored) {
return ErrNoRestoredChannelMutation return ErrNoRestoredChannelMutation
@ -1600,7 +1600,7 @@ func (c *OpenChannel) AdvanceCommitChainTail(fwdPkg *FwdPkg) error {
defer c.Unlock() defer c.Unlock()
// If this is a restored channel, then we want to avoid mutating the // If this is a restored channel, then we want to avoid mutating the
// state as all, as it's impossible to do so in a protocol compliant // state at all, as it's impossible to do so in a protocol compliant
// manner. // manner.
if c.hasChanStatus(ChanStatusRestored) { if c.hasChanStatus(ChanStatusRestored) {
return ErrNoRestoredChannelMutation return ErrNoRestoredChannelMutation
@ -1841,10 +1841,10 @@ func (c *OpenChannel) RevocationLogTail() (*ChannelCommitment, error) {
} }
// CommitmentHeight returns the current commitment height. The commitment // CommitmentHeight returns the current commitment height. The commitment
// height represents the number of updates to the commitment state to data. // height represents the number of updates to the commitment state to date.
// This value is always monotonically increasing. This method is provided in // This value is always monotonically increasing. This method is provided in
// order to allow multiple instances of a particular open channel to obtain a // order to allow multiple instances of a particular open channel to obtain a
// consistent view of the number of channel updates to data. // consistent view of the number of channel updates to date.
func (c *OpenChannel) CommitmentHeight() (uint64, error) { func (c *OpenChannel) CommitmentHeight() (uint64, error) {
c.RLock() c.RLock()
defer c.RUnlock() defer c.RUnlock()
@ -2005,13 +2005,13 @@ type ChannelCloseSummary struct {
// confirmed, but not yet been fully resolved. In the case of a channel // confirmed, but not yet been fully resolved. In the case of a channel
// that has been cooperatively closed, it will go straight into the // that has been cooperatively closed, it will go straight into the
// fully resolved state as soon as the closing transaction has been // fully resolved state as soon as the closing transaction has been
// confirmed. However, for channel that have been force closed, they'll // confirmed. However, for channels that have been force closed, they'll
// stay marked as "pending" until _all_ the pending funds have been // stay marked as "pending" until _all_ the pending funds have been
// swept. // swept.
IsPending bool IsPending bool
// RemoteCurrentRevocation is the current revocation for their // RemoteCurrentRevocation is the current revocation for their
// commitment transaction. However, since this the derived public key, // commitment transaction. However, since this is the derived public key,
// we don't yet have the private key so we aren't yet able to verify // we don't yet have the private key so we aren't yet able to verify
// that it's actually in the hash chain. // that it's actually in the hash chain.
RemoteCurrentRevocation *btcec.PublicKey RemoteCurrentRevocation *btcec.PublicKey

@ -241,7 +241,7 @@ type fundingConfig struct {
// so that the channel creation process can be completed. // so that the channel creation process can be completed.
Notifier chainntnfs.ChainNotifier Notifier chainntnfs.ChainNotifier
// SignMessage signs an arbitrary method with a given public key. The // SignMessage signs an arbitrary message with a given public key. The
// actual digest signed is the double sha-256 of the message. In the // actual digest signed is the double sha-256 of the message. In the
// case that the private key corresponding to the passed public key // case that the private key corresponding to the passed public key
// cannot be located, then an error is returned. // cannot be located, then an error is returned.
@ -346,7 +346,7 @@ type fundingConfig struct {
// fundingManager acts as an orchestrator/bridge between the wallet's // fundingManager acts as an orchestrator/bridge between the wallet's
// 'ChannelReservation' workflow, and the wire protocol's funding initiation // 'ChannelReservation' workflow, and the wire protocol's funding initiation
// messages. Any requests to initiate the funding workflow for a channel, // messages. Any requests to initiate the funding workflow for a channel,
// either kicked-off locally or remotely handled by the funding manager. // either kicked-off locally or remotely are handled by the funding manager.
// Once a channel's funding workflow has been completed, any local callers, the // Once a channel's funding workflow has been completed, any local callers, the
// local peer, and possibly the remote peer are notified of the completion of // local peer, and possibly the remote peer are notified of the completion of
// the channel workflow. Additionally, any temporary or permanent access // the channel workflow. Additionally, any temporary or permanent access
@ -1083,7 +1083,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) {
// As we're the responder, we get to specify the number of confirmations // As we're the responder, we get to specify the number of confirmations
// that we require before both of us consider the channel open. We'll // that we require before both of us consider the channel open. We'll
// use out mapping to derive the proper number of confirmations based on // use our mapping to derive the proper number of confirmations based on
// the amount of the channel, and also if any funds are being pushed to // the amount of the channel, and also if any funds are being pushed to
// us. // us.
numConfsReq := f.cfg.NumRequiredConfs(msg.FundingAmount, msg.PushAmount) numConfsReq := f.cfg.NumRequiredConfs(msg.FundingAmount, msg.PushAmount)
@ -1644,7 +1644,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
// Now that we have a finalized reservation for this funding flow, // Now that we have a finalized reservation for this funding flow,
// we'll send the to be active channel to the ChainArbitrator so it can // we'll send the to be active channel to the ChainArbitrator so it can
// watch for any on-chin actions before the channel has fully // watch for any on-chain actions before the channel has fully
// confirmed. // confirmed.
if err := f.cfg.WatchNewChannel(completeChan, peerKey); err != nil { if err := f.cfg.WatchNewChannel(completeChan, peerKey); err != nil {
fndgLog.Errorf("Unable to send new ChannelPoint(%v) for "+ fndgLog.Errorf("Unable to send new ChannelPoint(%v) for "+
@ -2407,8 +2407,8 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) {
f.localDiscoveryMtx.Unlock() f.localDiscoveryMtx.Unlock()
} }
// First, we'll attempt to locate the channel who's funding workflow is // First, we'll attempt to locate the channel whose funding workflow is
// being finalized by this message. We got to the database rather than // being finalized by this message. We go to the database rather than
// our reservation map as we may have restarted, mid funding flow. // our reservation map as we may have restarted, mid funding flow.
chanID := fmsg.msg.ChanID chanID := fmsg.msg.ChanID
channel, err := f.cfg.FindChannel(chanID) channel, err := f.cfg.FindChannel(chanID)
@ -2437,7 +2437,7 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) {
} }
// Launch a defer so we _ensure_ that the channel barrier is properly // Launch a defer so we _ensure_ that the channel barrier is properly
// closed even if the target peer is not longer online at this point. // closed even if the target peer is no longer online at this point.
defer func() { defer func() {
// Close the active channel barrier signalling the readHandler // Close the active channel barrier signalling the readHandler
// that commitment related modifications to this channel can // that commitment related modifications to this channel can
@ -2644,7 +2644,7 @@ func (f *fundingManager) announceChannel(localIDKey, remoteIDKey, localFundingKe
} }
// We only send the channel proof announcement and the node announcement // We only send the channel proof announcement and the node announcement
// because addToRouterGraph previously send the ChannelAnnouncement and // because addToRouterGraph previously sent the ChannelAnnouncement and
// the ChannelUpdate announcement messages. The channel proof and node // the ChannelUpdate announcement messages. The channel proof and node
// announcements are broadcast to the greater network. // announcements are broadcast to the greater network.
errChan := f.cfg.SendAnnouncement(ann.chanProof) errChan := f.cfg.SendAnnouncement(ann.chanProof)

@ -108,7 +108,7 @@ func NewBaseInput(outpoint *wire.OutPoint, witnessType WitnessType,
} }
// CraftInputScript returns a valid set of input scripts allowing this output // CraftInputScript returns a valid set of input scripts allowing this output
// to be spent. The returns input scripts should target the input at location // to be spent. The returned input scripts should target the input at location
// txIndex within the passed transaction. The input scripts generated by this // txIndex within the passed transaction. The input scripts generated by this
// method support spending p2wkh, p2wsh, and also nested p2sh outputs. // method support spending p2wkh, p2wsh, and also nested p2sh outputs.
func (bi *BaseInput) CraftInputScript(signer Signer, txn *wire.MsgTx, func (bi *BaseInput) CraftInputScript(signer Signer, txn *wire.MsgTx,

@ -315,7 +315,7 @@ func SenderHtlcSpendRedeem(signer Signer, signDesc *SignDescriptor,
return nil, err return nil, err
} }
// The stack require to spend this output is simply the signature // The stack required to spend this output is simply the signature
// generated above under the receiver's public key, and the payment // generated above under the receiver's public key, and the payment
// pre-image. // pre-image.
witnessStack := wire.TxWitness(make([][]byte, 3)) witnessStack := wire.TxWitness(make([][]byte, 3))
@ -340,7 +340,7 @@ func SenderHtlcSpendTimeout(receiverSig []byte, signer Signer,
// We place a zero as the first item of the evaluated witness stack in // We place a zero as the first item of the evaluated witness stack in
// order to force Script execution to the HTLC timeout clause. The // order to force Script execution to the HTLC timeout clause. The
// second zero is require to consume the extra pop due to a bug in the // second zero is required to consume the extra pop due to a bug in the
// original OP_CHECKMULTISIG. // original OP_CHECKMULTISIG.
witnessStack := wire.TxWitness(make([][]byte, 5)) witnessStack := wire.TxWitness(make([][]byte, 5))
witnessStack[0] = nil witnessStack[0] = nil
@ -832,7 +832,7 @@ func CommitScriptToSelf(csvTimeout uint32, selfKey, revokeKey *btcec.PublicKey)
// transaction paying to the "other" party. The constructed output is a normal // transaction paying to the "other" party. The constructed output is a normal
// p2wkh output spendable immediately, requiring no contestation period. // p2wkh output spendable immediately, requiring no contestation period.
func CommitScriptUnencumbered(key *btcec.PublicKey) ([]byte, error) { func CommitScriptUnencumbered(key *btcec.PublicKey) ([]byte, error) {
// This script goes to the "other" party, and it spendable immediately. // This script goes to the "other" party, and is spendable immediately.
builder := txscript.NewScriptBuilder() builder := txscript.NewScriptBuilder()
builder.AddOp(txscript.OP_0) builder.AddOp(txscript.OP_0)
builder.AddData(btcutil.Hash160(key.SerializeCompressed())) builder.AddData(btcutil.Hash160(key.SerializeCompressed()))
@ -961,8 +961,8 @@ func SingleTweakBytes(commitPoint, basePoint *btcec.PublicKey) []byte {
// := G*(k + sha256(commitPoint || basePoint)) // := G*(k + sha256(commitPoint || basePoint))
// //
// Therefore, if a party possess the value k, the private key of the base // Therefore, if a party possess the value k, the private key of the base
// point, then they are able to derive the private key by computing: compute // point, then they are able to derive the proper private key for the
// the proper private key for the revokeKey by computing: // revokeKey by computing:
// //
// revokePriv := k + sha256(commitPoint || basePoint) mod N // revokePriv := k + sha256(commitPoint || basePoint) mod N
// //

@ -427,7 +427,7 @@ func (r *ChannelReservation) OurSignatures() ([]*input.Script, []byte) {
// https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki. // https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki.
// Additionally, verification is performed in order to ensure that the // Additionally, verification is performed in order to ensure that the
// counterparty supplied a valid signature to our version of the commitment // counterparty supplied a valid signature to our version of the commitment
// transaction. Once this method returns, caller's should broadcast the // transaction. Once this method returns, callers should broadcast the
// created funding transaction, then call .WaitForChannelOpen() which will // created funding transaction, then call .WaitForChannelOpen() which will
// block until the funding transaction obtains the configured number of // block until the funding transaction obtains the configured number of
// confirmations. Once the method unblocks, a LightningChannel instance is // confirmations. Once the method unblocks, a LightningChannel instance is