Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge with upstream #4

Merged
merged 6 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.6.1-rc1] - 2018-08-25: "Principled Opposition To Segwit"
## [0.6.1] - 2018-09-11: "Principled Opposition To Segwit"

This release named by ZmnSCPxj.

Expand Down Expand Up @@ -133,8 +133,8 @@ There predate the BOLT specifications, and are only of vague historic interest:
6. [0.5.1] - 2016-10-21
7. [0.5.2] - 2016-11-21: "Bitcoin Savings & Trust Daily Interest II"

[Unreleased]: https://github.com/ElementsProject/lightning/compare/v0.6...HEAD
[0.6.1-rc1]: https://github.com/ElementsProject/lightning/releases/tag/v0.6.1-rc1
[Unreleased]: https://github.com/ElementsProject/lightning/compare/v0.6.1...HEAD
[0.6.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.6.1
[0.6]: https://github.com/ElementsProject/lightning/releases/tag/v0.6
[0.5.2]: https://github.com/ElementsProject/lightning/releases/tag/v0.5.2-2016-11-21
[0.5.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.5.1-2016-10-21
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ check-makefile:
bolt-check/%: % bolt-precheck tools/check-bolt
@[ ! -d .tmp.lightningrfc ] || tools/check-bolt .tmp.lightningrfc $<

LOCAL_BOLTDIR=.tmp.lightningrfc

bolt-precheck:
@rm -rf .tmp.lightningrfc; if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; exit 0; fi; set -e; if [ -n "$(BOLTVERSION)" ]; then git clone -q $(BOLTDIR) .tmp.lightningrfc && cd .tmp.lightningrfc && git checkout -q $(BOLTVERSION); else cp -a $(BOLTDIR) .tmp.lightningrfc; fi
@rm -rf $(LOCAL_BOLTDIR); if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist >&2; exit 0; fi; set -e; if [ -n "$(BOLTVERSION)" ]; then git clone -q $(BOLTDIR) $(LOCAL_BOLTDIR) && cd $(LOCAL_BOLTDIR) && git checkout -q $(BOLTVERSION); else cp -a $(BOLTDIR) $(LOCAL_BOLTDIR); fi

check-source-bolt: $(ALL_TEST_PROGRAMS:%=bolt-check/%.c)

Expand Down
6 changes: 3 additions & 3 deletions lightningd/gossip_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static void json_dev_query_scids(struct command *cmd,
static const struct json_command dev_query_scids_command = {
"dev-query-scids",
json_dev_query_scids,
"Query {peerid} for [scids]"
"Query peer {id} for [scids]"
};
AUTODATA(json_command, &dev_query_scids_command);

Expand Down Expand Up @@ -487,7 +487,7 @@ static void json_dev_send_timestamp_filter(struct command *cmd,
static const struct json_command dev_send_timestamp_filter = {
"dev-send-timestamp-filter",
json_dev_send_timestamp_filter,
"Send {peerid} the timestamp filter {first} {range}"
"Send peer {id} the timestamp filter {first} {range}"
};
AUTODATA(json_command, &dev_send_timestamp_filter);

Expand Down Expand Up @@ -554,7 +554,7 @@ static void json_dev_query_channel_range(struct command *cmd,
static const struct json_command dev_query_channel_range_command = {
"dev-query-channel-range",
json_dev_query_channel_range,
"Query {peerid} for short_channel_ids for {first} block + {num} blocks"
"Query peer {id} for short_channel_ids for {first} block + {num} blocks"
};
AUTODATA(json_command, &dev_query_channel_range_command);

Expand Down
2 changes: 1 addition & 1 deletion lightningd/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ static void json_ping(struct command *cmd,
static const struct json_command ping_command = {
"ping",
json_ping,
"Send {peerid} a ping of length {len} (default 128) asking for {pongbytes} (default 128)"
"Send peer {id} a ping of length {len} (default 128) asking for {pongbytes} (default 128)"
};
AUTODATA(json_command, &ping_command);
16 changes: 10 additions & 6 deletions wire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
wire-wrongdir:
$(MAKE) -C .. wire-all

WIRE_HEADERS_NOGEN := wire/peer_wire.h \
WIRE_HEADERS_NOGEN := wire/onion_defs.h \
wire/peer_wire.h \
wire/wire.h \
wire/wire_sync.h \
wire/wire_io.h
Expand All @@ -25,12 +26,15 @@ ALL_OBJS += $(WIRE_OBJS) $(WIRE_ONION_OBJS)
ALL_GEN_HEADERS += $(WIRE_GEN_HEADERS)

# They may not have the bolts.
BOLT_EXTRACT=$(BOLTDIR)/tools/extract-formats.py
wire/gen_peer_wire_csv: FORCE
@set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(BOLTDIR)/0[127]*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then $(BOLT_EXTRACT) --message-fields --message-types $(BOLTDIR)/0[127]*.md > $@; break; fi; done; fi
BOLT_EXTRACT=$(LOCAL_BOLTDIR)/tools/extract-formats.py

wire/gen_onion_wire_csv: FORCE
@set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(BOLTDIR)/04*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then echo '#include <wire/onion_defs.h>' > $@ && $(BOLT_EXTRACT) --message-fields --message-types $(BOLTDIR)/04*.md >> $@; break; fi; done; fi
ifeq ($(DEVELOPER),1)
wire/gen_peer_wire_csv: bolt-precheck
@set -e; if [ -d $(LOCAL_BOLTDIR) ]; then for f in $(LOCAL_BOLTDIR)/0[127]*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then $(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/0[127]*.md > $@; break; fi; done; fi

wire/gen_onion_wire_csv: bolt-precheck
@set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(LOCAL_BOLTDIR)/04*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then echo '#include <wire/onion_defs.h>' > $@ && $(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/04*.md >> $@; break; fi; done; fi
endif

wire/gen_peer_wire.h: $(WIRE_GEN) wire/gen_peer_wire_csv
$(WIRE_GEN) --bolt --header $@ wire_type < wire/gen_peer_wire_csv > $@
Expand Down
6 changes: 4 additions & 2 deletions wire/gen_peer_wire_csv
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ open_channel,252,htlc_basepoint,33
open_channel,285,first_per_commitment_point,33
open_channel,318,channel_flags,1
open_channel,319,shutdown_len,2,option_upfront_shutdown_script
open_channel,321,shutdown_scriptpubkey,shutdown_len,option_upfront_shutdown_script
accept_channel,33
accept_channel,0,temporary_channel_id,32
accept_channel,32,dust_limit_satoshis,8
Expand All @@ -50,6 +51,7 @@ accept_channel,171,delayed_payment_basepoint,33
accept_channel,204,htlc_basepoint,33
accept_channel,237,first_per_commitment_point,33
accept_channel,270,shutdown_len,2,option_upfront_shutdown_script
accept_channel,272,shutdown_scriptpubkey,shutdown_len,option_upfront_shutdown_script
funding_created,34
funding_created,0,temporary_channel_id,32
funding_created,32,funding_txid,32
Expand Down Expand Up @@ -106,8 +108,8 @@ channel_reestablish,136
channel_reestablish,0,channel_id,32
channel_reestablish,32,next_local_commitment_number,8
channel_reestablish,40,next_remote_revocation_number,8
channel_reestablish,48,your_last_per_commitment_secret,32,option-data-loss-protect
channel_reestablish,80,my_current_per_commitment_point,33,option-data-loss-protect
channel_reestablish,48,your_last_per_commitment_secret,32,option_data_loss_protect
channel_reestablish,80,my_current_per_commitment_point,33,option_data_loss_protect
announcement_signatures,259
announcement_signatures,0,channel_id,32
announcement_signatures,32,short_channel_id,8
Expand Down
5 changes: 3 additions & 2 deletions wire/onion_defs.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* Macro definitions for constants used in BOLT #4 */
#ifndef LIGHTNING_WIRE_ONION_DEFS_H
#define LIGHTNING_WIRE_ONION_DEFS_H
#include "config.h"

/* BOLT #4:
*
* The top byte of `failure-code` can be read as a set of flags:
* * 0x8000 (BADONION): unparsable onion, encrypted by previous node.
* The top byte of `failure_code` can be read as a set of flags:
* * 0x8000 (BADONION): unparsable onion encrypted by sending peer
* * 0x4000 (PERM): permanent failure (otherwise transient)
* * 0x2000 (NODE): node failure (otherwise channel)
* * 0x1000 (UPDATE): new channel update enclosed
Expand Down