From 61c47c09d05c1e8db413bf743f09366b4982cb64 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Thu, 7 Dec 2017 23:59:39 +0100 Subject: [PATCH] Fix typos --- Makefile | 2 +- README.md | 2 +- channeld/full_channel.c | 2 +- common/bech32.h | 2 +- common/json.c | 2 +- common/permute_tx.c | 2 +- common/withdraw_tx.h | 2 +- doc/HACKING.md | 4 ++-- gossipd/routing.c | 4 ++-- lightningd/chaintopology.h | 4 ++-- lightningd/jsonrpc.c | 2 +- lightningd/log.c | 2 +- lightningd/peer_control.c | 6 +++--- onchaind/onchain.c | 4 ++-- tests/test_lightningd.py | 4 ++-- tools/generate-wire.py | 2 +- wallet/db.c | 4 ++-- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 19e71251a..626dc1451 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ check-hdr-include-order/%: % check-makefile: @if [ x"$(CCANDIR)/config.h `find $(CCANDIR)/ccan -name '*.h' | grep -v /test/ | LC_ALL=C sort | tr '\n' ' '`" != x"$(CCAN_HEADERS) " ]; then echo CCAN_HEADERS incorrect; exit 1; fi -# Any mention of BOLT# must be followed by an exact quote, modulo whitepace. +# Any mention of BOLT# must be followed by an exact quote, modulo whitespace. bolt-check/%: % bolt-precheck tools/check-bolt @[ ! -d .tmp.lightningrfc ] || tools/check-bolt .tmp.lightningrfc $< diff --git a/README.md b/README.md index e78e90d61..fc207c924 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ This returns a random value called `rhash` that is part of the invoice. The recipient needs to communicate its ID ``, `` and the desired `` to the sender. The sender needs to compute a route to the recipient, and use that route to actually send the payment. -The route contains the path that the payment will take throught the Lightning Network and the respective funds that each node will forward. +The route contains the path that the payment will take through the Lightning Network and the respective funds that each node will forward. ``` route=$(cli/lightning-cli getroute 1 | jq --raw-output .route -) diff --git a/channeld/full_channel.c b/channeld/full_channel.c index e251ba8c5..cf1b0549b 100644 --- a/channeld/full_channel.c +++ b/channeld/full_channel.c @@ -899,7 +899,7 @@ static bool adjust_balance(struct channel *channel, struct htlc *htlc) if (!htlc->fail && !htlc->malformed && !htlc->r) { status_trace("%s HTLC %"PRIu64 - " %s neither fail nor fulfull?", + " %s neither fail nor fulfill?", htlc_state_owner(htlc->state) == LOCAL ? "out" : "in", htlc->id, diff --git a/common/bech32.h b/common/bech32.h index 072b31293..fb3d57615 100644 --- a/common/bech32.h +++ b/common/bech32.h @@ -97,7 +97,7 @@ int bech32_encode( * of entries in data. * In: input: Pointer to a null-terminated Bech32 string. * max_input_len: Maximum valid length of input (90 for segwit usage). - * Returns 1 if succesful. + * Returns 1 if successful. */ int bech32_decode( char *hrp, diff --git a/common/json.c b/common/json.c index 22f918617..899f65fdc 100644 --- a/common/json.c +++ b/common/json.c @@ -310,7 +310,7 @@ again: /* Cut to length and return. */ *valid = true; tal_resize(&toks, ret + 1); - /* Make sure last one is always referencable. */ + /* Make sure last one is always referenceable. */ toks[ret].type = -1; toks[ret].start = toks[ret].end = toks[ret].size = 0; diff --git a/common/permute_tx.c b/common/permute_tx.c index 6f2e19508..505c63fed 100644 --- a/common/permute_tx.c +++ b/common/permute_tx.c @@ -91,7 +91,7 @@ static bool output_better(const struct bitcoin_tx_output *a, if (a->amount != b->amount) return a->amount < b->amount; - /* Lexographic sort. */ + /* Lexicographical sort. */ if (tal_len(a->script) < tal_len(b->script)) len = tal_len(a->script); else diff --git a/common/withdraw_tx.h b/common/withdraw_tx.h index 769709db0..eacfb508c 100644 --- a/common/withdraw_tx.h +++ b/common/withdraw_tx.h @@ -19,7 +19,7 @@ struct utxo; * @destination: (in) bitcoin_address to send to. * @amount: (in) satoshis to send to the destination * @changekey: (in) key to send change to (only used if change_satoshis != 0). - * @changesa: (in) amount to send as change. + * @changesat: (in) amount to send as change. * @bip32_base: (in) bip32 base for key derivation, or NULL. */ struct bitcoin_tx *withdraw_tx(const tal_t *ctx, diff --git a/doc/HACKING.md b/doc/HACKING.md index 5fb2bc351..41c05878b 100644 --- a/doc/HACKING.md +++ b/doc/HACKING.md @@ -14,7 +14,7 @@ It's in C, to encourage alternate implementations. It uses the Linux coding style. Patches are welcome! To read the code, you'll probably need to understand ccan/tal: it's a -heirarchical memory allocator, where each allocation has a parent, and +hierarchical memory allocator, where each allocation has a parent, and thus lifetimes are grouped. eg. a 'struct bitcoin_tx' has a pointer to an array of 'struct bitcoin_tx_input'; they are allocated off the 'struct bitcoind_tx', so freeing the 'struct bitcoind_tx' frees them @@ -34,7 +34,7 @@ Here's a list of parts, with notes: * bitcoin/ - bitcoin script, signature and transaction routines. - Not a complete set, but enough for our purposes. -* external/ - external libararies from other sources +* external/ - external libraries from other sources - libsodium - encryption library (should be replaced soon with built-in) - libwally-core - bitcoin helper library - secp256k1 - bitcoin curve encryption library within libwally-core diff --git a/gossipd/routing.c b/gossipd/routing.c index fc57423fc..0182d87a7 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -384,7 +384,7 @@ find_route(const tal_t *ctx, struct routing_state *rstate, msatoshi += *fee; status_trace("find_route: via %s", type_to_string(trc, struct pubkey, &first_conn->dst->id)); - /* If there are intermidiaries, dump them, and total fees. */ + /* If there are intermediaries, dump them, and total fees. */ if (best != 0) { for (i = 0; i < best; i++) { status_trace(" %s (%i+%i=%"PRIu64")", @@ -700,7 +700,7 @@ void handle_node_announcement( node = get_node(rstate, &node_id); if (!node) { - status_trace("Node not found, was the node_announcement preceeded by at least channel_announcement?"); + status_trace("Node not found, was the node_announcement preceded by at least channel_announcement?"); tal_free(tmpctx); return; } else if (node->last_timestamp >= timestamp) { diff --git a/lightningd/chaintopology.h b/lightningd/chaintopology.h index aceece3ef..7c47e2e54 100644 --- a/lightningd/chaintopology.h +++ b/lightningd/chaintopology.h @@ -107,10 +107,10 @@ struct chain_topology { /* Our timer list. */ struct timers *timers; - /* Bitcoin transctions we're broadcasting */ + /* Bitcoin transactions we're broadcasting */ struct list_head outgoing_txs; - /* Force a partiular fee rate regardless of estimatefee (satoshis/kb) */ + /* Force a particular fee rate regardless of estimatefee (satoshis/kb) */ u32 *override_fee_rate; /* What fee we use if estimatefee fails (satoshis/kb) */ diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 7720fc562..5075dcc90 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -471,7 +471,7 @@ static void parse_request(struct json_connection *jcon, const jsmntok_t tok[]) return; } - /* This is a convenient tal parent for durarion of command + /* This is a convenient tal parent for duration of command * (which may outlive the conn!). */ jcon->current = tal(jcon->ld, struct command); jcon->current->jcon = jcon; diff --git a/lightningd/log.c b/lightningd/log.c index efc3f8389..e0659271b 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -448,7 +448,7 @@ static void log_crash(int sig) logfile = "crash.log"; fd = open(logfile, O_WRONLY|O_CREAT, 0600); if (fd < 0) { - logfile = "/tmp/lighning-crash.log"; + logfile = "/tmp/lightning-crash.log"; fd = open(logfile, O_WRONLY|O_CREAT, 0600); } diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 66db12e5f..7454e6f57 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -1040,7 +1040,7 @@ static void onchaind_tell_fulfill(struct peer *peer) /* We only set preimage once it's irrevocably committed, and * we spend even if we don't have an outgoing HTLC (eg. local - * payyment complete) */ + * payment complete) */ if (!hin->preimage) continue; @@ -2226,7 +2226,7 @@ static void opening_funder_finished(struct subd *opening, const u8 *resp, /* old_remote_per_commit not valid yet, copy valid one. */ channel_info->old_remote_per_commit = channel_info->remote_per_commit; - /* Now, keep the initial commit as our last-tx-to-broadast. */ + /* Now, keep the initial commit as our last-tx-to-broadcast. */ peer_last_tx(fc->peer, remote_commit, &remote_commit_sig); /* Generate the funding tx. */ @@ -2350,7 +2350,7 @@ static void opening_fundee_finished(struct subd *opening, /* old_remote_per_commit not valid yet, copy valid one. */ channel_info->old_remote_per_commit = channel_info->remote_per_commit; - /* Now, keep the initial commit as our last-tx-to-broadast. */ + /* Now, keep the initial commit as our last-tx-to-broadcast. */ peer_last_tx(peer, remote_commit, &remote_commit_sig); if (!peer_commit_initial(peer)) diff --git a/onchaind/onchain.c b/onchaind/onchain.c index 01062b1eb..f4533653f 100644 --- a/onchaind/onchain.c +++ b/onchaind/onchain.c @@ -1497,7 +1497,7 @@ static void handle_their_cheat(const struct bitcoin_tx *tx, sizeof(per_commitment_privkey)); if (!pubkey_from_privkey(&per_commitment_privkey, &per_commitment_point)) status_failed(STATUS_FAIL_INTERNAL_ERROR, - "Failed derivea from per_commitment_secret %s", + "Failed derive from per_commitment_secret %s", type_to_string(trc, struct privkey, &per_commitment_privkey)); @@ -2061,7 +2061,7 @@ int main(int argc, char *argv[]) &remote_payment_basepoint); status_trace("commitnum = %"PRIu64 - ", revocations_recived = %"PRIu64, + ", revocations_received = %"PRIu64, commit_num, revocations_received(&shachain)); if (is_local_commitment(&txid, &our_broadcast_txid)) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index 75b5e4cd8..408c26cd0 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -250,7 +250,7 @@ class LightningDTests(BaseLightningDTests): if out['scriptPubKey']['type'] == 'witness_v0_scripthash': if out['value'] == Decimal(amount) / 10**8 or out['value'] * 10**8 == amount: return "{}:1:{}".format(bitcoind.rpc.getblockcount(), out['n']) - # Intermittant decoding failure. See if it decodes badly twice? + # Intermittent decoding failure. See if it decodes badly twice? decoded2=bitcoind.rpc.decoderawtransaction(tx) raise ValueError("Can't find {} payment in {} (1={} 2={})".format(amount, tx, decoded, decoded2)) @@ -1003,7 +1003,7 @@ class LightningDTests(BaseLightningDTests): l2.daemon.wait_for_log('Broadcasting OUR_DELAYED_RETURN_TO_WALLET .* to resolve OUR_UNILATERAL/DELAYED_OUTPUT_TO_US') l2.daemon.wait_for_log('sendrawtx exit 0') - # One more block, HTLC tx is now spentable. + # One more block, HTLC tx is now spendable. l1.bitcoin.generate_block(1) l2.daemon.wait_for_log('Broadcasting OUR_DELAYED_RETURN_TO_WALLET .* to resolve OUR_HTLC_SUCCESS_TX/DELAYED_OUTPUT_TO_US') l2.daemon.wait_for_log('sendrawtx exit 0') diff --git a/tools/generate-wire.py b/tools/generate-wire.py index 55910d85c..0b866d154 100755 --- a/tools/generate-wire.py +++ b/tools/generate-wire.py @@ -49,7 +49,7 @@ class FieldType(object): if typename in type2size: return type2size[typename] elif typename.startswith('struct ') or typename.startswith('enum '): - # We allow unknown structures/enums, for extensiblity (can only happen + # We allow unknown structures/enums, for extensibility (can only happen # if explicitly specified in csv) return 0 else: diff --git a/wallet/db.c b/wallet/db.c index 15d473d72..64b9e8b7f 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -254,7 +254,7 @@ static struct db *db_open(const tal_t *ctx, char *filename) sqlite3 *sql; if (SQLITE_VERSION_NUMBER != sqlite3_libversion_number()) - fatal("SQLITE version mistmatch: compiled %u, now %u", + fatal("SQLITE version mismatch: compiled %u, now %u", SQLITE_VERSION_NUMBER, sqlite3_libversion_number()); int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; @@ -305,7 +305,7 @@ static int db_get_version(struct db *db) } /** - * db_mirgation_count - Count how many migrations are available + * db_migration_count - Count how many migrations are available * * Returns the maximum migration index, i.e., the version number of an * up-to-date database schema.