multi: fix a variety of typos throughout the repo

This commit is contained in:
Trevin Hofmann authored and Olaoluwa Osuntokun committed 2017-01-17 17:02:56 -08:00
1 parent 49df1b0737
commit 40c7bac3aa
38 files changed
+311 -311

No files matched your search

+15 -15
View File
@@ -20,7 +20,7 @@ var (
// openChanBucket stores all the currently open channels. This bucket
// has a second, nested bucket which is keyed by a node's ID. Additionally,
// at the base level of this bucket several prefixed keys are stored which
// house channel meta-data such as total satoshis sent, number of updates
// house channel metadata such as total satoshis sent, number of updates
// etc. These fields are stored at this top level rather than within a
// node's channel bucket in order to facilitate sequential prefix scans
// to gather stats such as total satoshis received.
@@ -41,7 +41,7 @@ var (
// channelLogBucket is dedicated for storing the necessary delta state
// between channel updates required to re-construct a past state in
// order to punish a counter party attempting a non-cooperative channel
// order to punish a counterparty attempting a non-cooperative channel
// closure. A channel log bucket is created for each node and is nested
// within a node's ID bucket.
channelLogBucket = []byte("clb")
@@ -81,7 +81,7 @@ var (
// commitment transactions in addition to the csvDelay for both.
commitTxnsKey = []byte("ctk")
// currentHtlcKey stores the set of fully locked-in HTLC's on our
// currentHtlcKey stores the set of fully locked-in HTLCs on our
// latest commitment state.
currentHtlcKey = []byte("chk")
@@ -90,7 +90,7 @@ var (
fundingTxnKey = []byte("fsk")
// elkremStateKey stores their current revocation hash, and our elkrem
// sender, and their elkrem reciever.
// sender, and their elkrem receiver.
elkremStateKey = []byte("esk")
// deliveryScriptsKey stores the scripts for the final delivery in the
@@ -101,7 +101,7 @@ var (
// ChannelType is an enum-like type that describes one of several possible
// channel types. Each open channel is associated with a particular type as the
// channel type may determine how higher level operations are conducted such as
// fee negotiation, channel closing, the format of HTLC's, etc.
// fee negotiation, channel closing, the format of HTLCs, etc.
// TODO(roasbeef): split up per-chain?
type ChannelType uint8
@@ -221,7 +221,7 @@ type OpenChannel struct {
RemoteCsvDelay uint32
// Current revocation for their commitment transaction. However, since
// this the derived public key, we don't yet have the pre-image so we
// this the derived public key, we don't yet have the preimage so we
// aren't yet able to verify that it's actually in the hash chain.
TheirCurrentRevocation *btcec.PublicKey
TheirCurrentRevocationHash [32]byte
@@ -251,7 +251,7 @@ type OpenChannel struct {
// CreationTime is the time this channel was initially created.
CreationTime time.Time
// Htlcs is the list of active, uncleared HTLC's currently pending
// Htlcs is the list of active, uncleared HTLCs currently pending
// within the channel.
Htlcs []*HTLC
@@ -342,7 +342,7 @@ func (c *OpenChannel) FullSyncWithAddr(addr *net.TCPAddr) error {
}
// Next, we need to establish a (possibly) new LinkNode
// relationship for this channel. The LinkNode meta-data contains
// relationship for this channel. The LinkNode metadata contains
// reachability, up-time, and service bits related information.
// TODO(roasbeef): net info shuld be in lnwire.NetAddress
linkNode := c.Db.NewLinkNode(wire.MainNet, c.IdentityPub, addr)
@@ -407,7 +407,7 @@ func (c *OpenChannel) UpdateCommitment(newCommitment *wire.MsgTx,
})
}
// HTLC is the on-disk representation of a hash time-locked contract. HTLC's
// HTLC is the on-disk representation of a hash time-locked contract. HTLCs
// are contained within ChannelDeltas which encode the current state of the
// commitment between state updates.
type HTLC struct {
@@ -451,7 +451,7 @@ func (h *HTLC) Copy() HTLC {
// ChannelDelta is a snapshot of the commitment state at a particular point in
// the commitment chain. With each state transition, a snapshot of the current
// state along with all non-settled HTLC's are recorded.
// state along with all non-settled HTLCs are recorded.
type ChannelDelta struct {
LocalBalance btcutil.Amount
RemoteBalance btcutil.Amount
@@ -514,7 +514,7 @@ func (c *OpenChannel) CommitmentHeight() (uint64, error) {
}
err := c.Db.View(func(tx *bolt.Tx) error {
// Get the bucket dedicated to storing the meta-data for open
// Get the bucket dedicated to storing the metadata for open
// channels.
openChanBucket := tx.Bucket(openChannelBucket)
if openChanBucket == nil {
@@ -569,7 +569,7 @@ func (c *OpenChannel) FindPreviousState(updateNum uint64) (*ChannelDelta, error)
// entails deleting all saved state within the database concerning this
// channel, as well as created a small channel summary for record keeping
// purposes.
// TODO(roasbeef): delete on-disk set of HTLC's
// TODO(roasbeef): delete on-disk set of HTLCs
func (c *OpenChannel) CloseChannel() error {
var b bytes.Buffer
if err := writeOutpoint(&b, c.ChanID); err != nil {
@@ -614,7 +614,7 @@ func (c *OpenChannel) CloseChannel() error {
}
// Now that the index to this channel has been deleted, purge
// the remaining channel meta-data from the database.
// the remaining channel metadata from the database.
if err := deleteOpenChannel(chanBucket, nodeChanBucket,
outPointBytes); err != nil {
return err
@@ -648,7 +648,7 @@ type ChannelSnapshot struct {
// Snapshot returns a read-only snapshot of the current channel state. This
// snapshot includes information concerning the current settled balance within
// the channel, meta-data detailing total flows, and any outstanding HTLCs.
// the channel, metadata detailing total flows, and any outstanding HTLCs.
func (c *OpenChannel) Snapshot() *ChannelSnapshot {
c.RLock()
defer c.RUnlock()
@@ -664,7 +664,7 @@ func (c *OpenChannel) Snapshot() *ChannelSnapshot {
TotalSatoshisReceived: c.TotalSatoshisReceived,
}
// Copy over the current set of HTLC's to ensure the caller can't
// Copy over the current set of HTLCs to ensure the caller can't
// mutate our internal state.
snapshot.Htlcs = make([]HTLC, len(c.Htlcs))
for i, h := range c.Htlcs {
+4 -4
View File
@@ -378,8 +378,8 @@ func TestChannelStateTransition(t *testing.T) {
t.Fatalf("unable to save and serialize channel state: %v", err)
}
// Add some HTLC's which were added during this new state transition.
// Half of the HTLC's are incoming, while the other half are outgoing.
// Add some HTLCs which were added during this new state transition.
// Half of the HTLCs are incoming, while the other half are outgoing.
var htlcs []*HTLC
for i := uint32(0); i < 10; i++ {
var incoming bool
@@ -397,7 +397,7 @@ func TestChannelStateTransition(t *testing.T) {
htlcs = append(htlcs, htlc)
}
// Create a new channel delta which includes the above HTLC's, some
// Create a new channel delta which includes the above HTLCs, some
// balance updates, and an increment of the current commitment height.
// Additionally, modify the signature and commitment transaction.
newSequence := uint32(129498)
@@ -416,7 +416,7 @@ func TestChannelStateTransition(t *testing.T) {
t.Fatalf("unable to update commitment: %v", err)
}
// The balances, new update, the HTLC's and the changes to the fake
// The balances, new update, the HTLCs and the changes to the fake
// commitment transaction along with the modified signature should all
// have been updated.
updatedChannel, err := cdb.FetchOpenChannels(channel.IdentityPub)
+3 -3
View File
@@ -215,7 +215,7 @@ func fileExists(path string) bool {
func (d *DB) FetchOpenChannels(nodeID *btcec.PublicKey) ([]*OpenChannel, error) {
var channels []*OpenChannel
err := d.View(func(tx *bolt.Tx) error {
// Get the bucket dedicated to storing the meta-data for open
// Get the bucket dedicated to storing the metadata for open
// channels.
openChanBucket := tx.Bucket(openChannelBucket)
if openChanBucket == nil {
@@ -295,14 +295,14 @@ func (d *DB) FetchAllChannels() ([]*OpenChannel, error) {
var channels []*OpenChannel
err := d.View(func(tx *bolt.Tx) error {
// Get the bucket dedicated to storing the meta-data for open
// Get the bucket dedicated to storing the metadata for open
// channels.
openChanBucket := tx.Bucket(openChannelBucket)
if openChanBucket == nil {
return ErrNoActiveChannels
}
// Next, fetch the bucket dedicated to storing meta-data
// Next, fetch the bucket dedicated to storing metadata
// related to all nodes. All keys within this bucket are the
// serialized public keys of all our direct counterparties.
nodeMetaBucket := tx.Bucket(nodeInfoBucket)
+2 -2
View File
@@ -231,7 +231,7 @@ func (c *ChannelGraph) ForEachNode(cb func(*LightningNode) error) error {
}
// SourceNode returns the source node of the graph. The source node is treated
// as the center node within a star-graph. This method may be used to kick-off
// as the center node within a star-graph. This method may be used to kick off
// a path finding algorithm in order to explore the reachability of another
// node based off the source node.
func (c *ChannelGraph) SourceNode() (*LightningNode, error) {
@@ -1013,7 +1013,7 @@ type ChannelEdge struct {
FeeBaseMSat btcutil.Amount
// FeeProportionalMillionths is the rate that the node will charge for
// HTLC's for each millionth of a satoshi forwarded.
// HTLCs for each millionth of a satoshi forwarded.
FeeProportionalMillionths btcutil.Amount
// Capacity is the total capacity of the channel, this is determined by
+1 -1
View File
@@ -23,7 +23,7 @@ var (
// invoiceBucket which indexes all invoices by their payment hash. The
// payment hash is the sha256 of the invoice's payment preimage. This
// index is used to detect duplicates, and also to provide a fast path
// for looking up incoming HTLC's to determine if we're able to settle
// for looking up incoming HTLCs to determine if we're able to settle
// them fully.
invoiceIndexBucket = []byte("paymenthashes")
+5 -5
View File
@@ -12,20 +12,20 @@ import (
)
var (
// nodeInfoBucket stores meta-data pertaining to nodes that we've had
// nodeInfoBucket stores metadata pertaining to nodes that we've had
// direct channel-based correspondence with. This bucket allows one to
// query for all open channels pertaining to the node by exploring each
// node's sub-bucket within the openChanBucket.
nodeInfoBucket = []byte("nib")
)
// LinkNode stores meta-data related to node's that we have/had a direct
// LinkNode stores metadata related to node's that we have/had a direct
// channel open with. Information such as the Bitcoin network the node
// advertised, and its identity public key are also stored. Additionally, this
// struct and the bucket its stored within have store data similar to that of
// Bitcion's addrmanager. The TCP address information stored within the struct
// can be used to establish persistent connections will all channel
// counter-parties on daemon startup.
// counterparties on daemon startup.
//
// TODO(roasbeef): also add current OnionKey plus rotation schedule?
// TODO(roasbeef): add bitfield for supported services
@@ -123,7 +123,7 @@ func putLinkNode(nodeMetaBucket *bolt.Bucket, l *LinkNode) error {
return err
}
// Finally insert the link-node into the node meta-data bucket keyed
// Finally insert the link-node into the node metadata bucket keyed
// according to the its pubkey serialized in compressed form.
nodePub := l.IdentityPub.SerializeCompressed()
return nodeMetaBucket.Put(nodePub, b.Bytes())
@@ -139,7 +139,7 @@ func (db *DB) FetchLinkNode(identity *btcec.PublicKey) (*LinkNode, error) {
)
err = db.View(func(tx *bolt.Tx) error {
// First fetch the bucket for storing node meta-data, bailing
// First fetch the bucket for storing node metadata, bailing
// out early if it hasn't been created yet.
nodeMetaBucket := tx.Bucket(nodeInfoBucket)
if nodeMetaBucket == nil {