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

[WIP] add Groestl support for c-lightning #3

Merged
merged 14 commits into from
Sep 20, 2018
6 changes: 4 additions & 2 deletions connectd/tor_autoservice.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ static struct wireaddr *make_onion(const tal_t *ctx,

//V3 tor after 3.3.3.aplha FIXME: TODO SAIBATO
//sprintf((char *)reach->buffer,"ADD_ONION NEW:ED25519-V3 Port=9735,127.0.0.1:9735\r\n");
//V2 ADD_ONION NEW:RSA1024 Port=%d,%s Flags=DiscardPK,Detach",
tor_send_cmd(rbuf,
tal_fmt(tmpctx, "ADD_ONION NEW:RSA1024 Port=%d,%s Flags=DiscardPK,Detach",
/* make V3 the default */
tal_fmt(tmpctx, "ADD_ONION NEW:ED25519-V3 Port=%d,%s Flags=DiscardPK,Detach",
/* FIXME: We *could* allow user to set Tor port */
DEFAULT_PORT, fmt_wireaddr(tmpctx, local)));

Expand All @@ -97,7 +99,7 @@ static struct wireaddr *make_onion(const tal_t *ctx,

name = tal_fmt(tmpctx, "%s.onion", line);
onion = tal(ctx, struct wireaddr);
if (!parse_wireaddr(name, onion, 0, false, NULL))
if (!parse_wireaddr(name, onion, DEFAULT_PORT, false, NULL))
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Tor gave bad onion name '%s'", name);
discard_remaining_response(rbuf);
Expand Down
2 changes: 1 addition & 1 deletion lightningd/chaintopology.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ static void json_feerates(struct command *cmd,
static const struct json_command feerates_command = {
"feerates",
json_feerates,
"Return feerate estimates, either groshi-per-kw ({style} perkw) or groshi-per-kb ({style} perkb)."
"Return feerate estimates, either gro-per-kw ({style} perkw) or groshi-per-kb ({style} perkb)."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groshi-per-kb > gro-per-kb

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs to be resolved

gruve-p marked this conversation as resolved.
Show resolved Hide resolved
};
AUTODATA(json_command, &feerates_command);

Expand Down
2 changes: 1 addition & 1 deletion lightningd/opening_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,6 @@ static void json_fund_channel(struct command *cmd,
static const struct json_command fund_channel_command = {
"fundchannel",
json_fund_channel,
"Fund channel with {id} using {gro} (or 'all') groshi, at optional {feerate}"
"Fund channel with {id} using {gro} (or 'all') gro's, at optional {feerate}"
};
AUTODATA(json_command, &fund_channel_command);
6 changes: 3 additions & 3 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ static void config_register_opts(struct lightningd *ld)
"Time after changes before sending out COMMIT");
opt_register_arg("--fee-base", opt_set_u32, opt_show_u32,
&ld->config.fee_base,
"Milligroshi minimum to charge for HTLC");
"Milligro minimum to charge for HTLC");
opt_register_arg("--rescan", opt_set_s32, opt_show_s32,
&ld->config.rescan,
"Number of blocks to rescan from the current head, or "
"absolute blockheight if negative");
opt_register_arg("--fee-per-groshi", opt_set_s32, opt_show_s32,
opt_register_arg("--fee-per-gro", opt_set_s32, opt_show_s32,
&ld->config.fee_per_satoshi,
"Microgroshi fee for every groshi in HTLC");
"Microgro fee for every gro in HTLC");
opt_register_arg("--addr", opt_add_addr, NULL,
ld,
"Set an IP address (v4 or v6) to listen on and announce to the network for incoming connections");
Expand Down
6 changes: 3 additions & 3 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ static void json_add_peer(struct lightningd *ld,
channel->funding_satoshi * 1000);

/* channel config */
json_add_u64(response, "dust_limit_groshi",
json_add_u64(response, "dust_limit_gro",
channel->our_config.dust_limit_satoshis);
json_add_u64(response, "max_htlc_value_in_flight_mgro",
channel->our_config.max_htlc_value_in_flight_msat);
Expand All @@ -679,9 +679,9 @@ static void json_add_peer(struct lightningd *ld,
* is imposed on their side, while their
* configuration `channel_reserve_satoshis` is
* imposed on ours. */
json_add_u64(response, "their_channel_reserve_groshi",
json_add_u64(response, "their_channel_reserve_gro",
channel->our_config.channel_reserve_satoshis);
json_add_u64(response, "our_channel_reserve_groshi",
json_add_u64(response, "our_channel_reserve_gro",
channel->channel_info.their_config.channel_reserve_satoshis);
/* Compute how much we can send via this channel. */
if (channel->our_msatoshi <= our_reserve_msat)
Expand Down
6 changes: 3 additions & 3 deletions wallet/walletrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static const struct json_command withdraw_command = {
"withdraw",
json_withdraw,
"Send to {destination} address {gro} (or 'all') amount via Groestlcoin transaction, at optional {feerate}",
false, "Send funds from the internal wallet to the specified address. Either specify a number of groshi to send or 'all' to sweep all funds in the internal wallet to the address."
false, "Send funds from the internal wallet to the specified address. Either specify a number of gro's to send or 'all' to sweep all funds in the internal wallet to the address."
};
AUTODATA(json_command, &withdraw_command);

Expand Down Expand Up @@ -435,9 +435,9 @@ static void json_listfunds(struct command *cmd, const char *buffer UNUSED,
c->scid);

/* Poor man's rounding to satoshis to match the unit for outputs */
json_add_u64(response, "channel_groshi",
json_add_u64(response, "channel_gro",
(c->our_msatoshi + 500)/1000);
json_add_u64(response, "channel_total_groshi",
json_add_u64(response, "channel_total_gro",
c->funding_satoshi);
json_add_txid(response, "funding_txid",
&c->funding_txid);
Expand Down