mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
build: allow DEVELOPER builds with -Og and gcc 9.4.0
Removes some warnings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
d2edeff698
commit
7fa1364645
@ -160,6 +160,8 @@ static const struct htlc **include_htlcs(struct channel *channel, enum side side
|
||||
sender = !side;
|
||||
msatoshi = AMOUNT_MSAT(4000000);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
assert(msatoshi.millisatoshis != 0);
|
||||
|
||||
|
@ -22,8 +22,10 @@ char *billboard_message(const tal_t *ctx,
|
||||
depth_togo);
|
||||
else if (channel_ready[LOCAL] && !channel_ready[REMOTE])
|
||||
funding_status = "We've confirmed channel ready, they haven't yet.";
|
||||
else if (!channel_ready[LOCAL] && channel_ready[REMOTE])
|
||||
else {
|
||||
assert(!channel_ready[LOCAL] && channel_ready[REMOTE]);
|
||||
funding_status = "They've confirmed channel ready, we haven't yet.";
|
||||
}
|
||||
|
||||
if (have_sigs) {
|
||||
if (have_sigs[LOCAL] && have_sigs[REMOTE])
|
||||
@ -34,8 +36,10 @@ char *billboard_message(const tal_t *ctx,
|
||||
else if (!have_sigs[LOCAL] && have_sigs[REMOTE])
|
||||
announce_status = " They need our announcement"
|
||||
" signatures.";
|
||||
else if (!have_sigs[LOCAL] && !have_sigs[REMOTE])
|
||||
else {
|
||||
assert(!have_sigs[LOCAL] && !have_sigs[REMOTE]);
|
||||
announce_status = "";
|
||||
}
|
||||
} else
|
||||
announce_status = "";
|
||||
|
||||
|
@ -734,15 +734,10 @@ json_to_address_scriptpubkey(const tal_t *ctx,
|
||||
char *addrz;
|
||||
const char *bip173;
|
||||
|
||||
bool parsed;
|
||||
bool right_network;
|
||||
u8 addr_version;
|
||||
|
||||
parsed =
|
||||
ripemd160_from_base58(&addr_version, &destination.addr,
|
||||
buffer + tok->start, tok->end - tok->start);
|
||||
|
||||
if (parsed) {
|
||||
if (ripemd160_from_base58(&addr_version, &destination.addr,
|
||||
buffer + tok->start, tok->end - tok->start)) {
|
||||
if (addr_version == chainparams->p2pkh_version) {
|
||||
*scriptpubkey = scriptpubkey_p2pkh(ctx, &destination);
|
||||
return ADDRESS_PARSE_SUCCESS;
|
||||
@ -754,10 +749,11 @@ json_to_address_scriptpubkey(const tal_t *ctx,
|
||||
return ADDRESS_PARSE_WRONG_NETWORK;
|
||||
}
|
||||
/* Insert other parsers that accept pointer+len here. */
|
||||
return ADDRESS_PARSE_UNRECOGNIZED;
|
||||
}
|
||||
|
||||
/* Generate null-terminated address. */
|
||||
addrz = tal_dup_arr(ctx, char, buffer + tok->start, tok->end - tok->start, 1);
|
||||
addrz = tal_dup_arr(tmpctx, char, buffer + tok->start, tok->end - tok->start, 1);
|
||||
addrz[tok->end - tok->start] = '\0';
|
||||
|
||||
bip173 = segwit_addr_net_decode(&witness_version, witness_program,
|
||||
@ -772,24 +768,18 @@ json_to_address_scriptpubkey(const tal_t *ctx,
|
||||
} else
|
||||
witness_ok = true;
|
||||
|
||||
if (witness_ok) {
|
||||
*scriptpubkey = scriptpubkey_witness_raw(ctx, witness_version,
|
||||
witness_program, witness_program_len);
|
||||
parsed = true;
|
||||
right_network = streq(bip173, chainparams->onchain_hrp);
|
||||
}
|
||||
}
|
||||
/* Insert other parsers that accept null-terminated string here. */
|
||||
if (!witness_ok)
|
||||
return ADDRESS_PARSE_UNRECOGNIZED;
|
||||
|
||||
tal_free(addrz);
|
||||
|
||||
if (parsed) {
|
||||
if (right_network)
|
||||
return ADDRESS_PARSE_SUCCESS;
|
||||
else
|
||||
if (!streq(bip173, chainparams->onchain_hrp))
|
||||
return ADDRESS_PARSE_WRONG_NETWORK;
|
||||
|
||||
*scriptpubkey = scriptpubkey_witness_raw(ctx, witness_version,
|
||||
witness_program, witness_program_len);
|
||||
return ADDRESS_PARSE_SUCCESS;
|
||||
}
|
||||
|
||||
/* Insert other parsers that accept null-terminated string here. */
|
||||
return ADDRESS_PARSE_UNRECOGNIZED;
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,7 @@ static struct command_result *finish_psbt(struct command *cmd,
|
||||
{
|
||||
struct json_stream *response;
|
||||
struct wally_psbt *psbt;
|
||||
size_t change_outnum;
|
||||
size_t change_outnum COMPILER_WANTS_INIT("gcc 9.4.0 -Og");
|
||||
u32 current_height = get_block_height(cmd->ld->topology);
|
||||
|
||||
/* Setting the locktime to the next block to be mined has multiple
|
||||
|
Loading…
Reference in New Issue
Block a user