mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
openingd: rename confusing 'our_commit' and 'their_commit'.
We use 'our_commit' for the commit we sign (ie. the remote commitment tx), and vice versa. Use local/remote nomenclature. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
e217bc1220
commit
ad9dbaaa3f
@@ -550,7 +550,7 @@ static u8 *fundee_channel(struct state *state,
|
|||||||
struct basepoints theirs;
|
struct basepoints theirs;
|
||||||
struct pubkey their_funding_pubkey;
|
struct pubkey their_funding_pubkey;
|
||||||
secp256k1_ecdsa_signature theirsig, sig;
|
secp256k1_ecdsa_signature theirsig, sig;
|
||||||
struct bitcoin_tx *their_commit, *our_commit;
|
struct bitcoin_tx *local_commit, *remote_commit;
|
||||||
struct bitcoin_blkid chain_hash;
|
struct bitcoin_blkid chain_hash;
|
||||||
u8 *msg;
|
u8 *msg;
|
||||||
const u8 *wscript;
|
const u8 *wscript;
|
||||||
@@ -736,20 +736,20 @@ static u8 *fundee_channel(struct state *state,
|
|||||||
* - if `signature` is incorrect:
|
* - if `signature` is incorrect:
|
||||||
* - MUST fail the channel.
|
* - MUST fail the channel.
|
||||||
*/
|
*/
|
||||||
their_commit = initial_channel_tx(state, &wscript, state->channel,
|
local_commit = initial_channel_tx(state, &wscript, state->channel,
|
||||||
&state->next_per_commit[LOCAL], LOCAL);
|
&state->next_per_commit[LOCAL], LOCAL);
|
||||||
if (!their_commit)
|
if (!local_commit)
|
||||||
negotiation_failed(state,
|
negotiation_failed(state,
|
||||||
"Could not meet our fees and reserve");
|
"Could not meet our fees and reserve");
|
||||||
|
|
||||||
if (!check_tx_sig(their_commit, 0, NULL, wscript, &their_funding_pubkey,
|
if (!check_tx_sig(local_commit, 0, NULL, wscript, &their_funding_pubkey,
|
||||||
&theirsig)) {
|
&theirsig)) {
|
||||||
peer_failed(&state->cs,
|
peer_failed(&state->cs,
|
||||||
&state->channel_id,
|
&state->channel_id,
|
||||||
"Bad signature %s on tx %s using key %s",
|
"Bad signature %s on tx %s using key %s",
|
||||||
type_to_string(tmpctx, secp256k1_ecdsa_signature,
|
type_to_string(tmpctx, secp256k1_ecdsa_signature,
|
||||||
&theirsig),
|
&theirsig),
|
||||||
type_to_string(tmpctx, struct bitcoin_tx, their_commit),
|
type_to_string(tmpctx, struct bitcoin_tx, local_commit),
|
||||||
type_to_string(tmpctx, struct pubkey,
|
type_to_string(tmpctx, struct pubkey,
|
||||||
&their_funding_pubkey));
|
&their_funding_pubkey));
|
||||||
}
|
}
|
||||||
@@ -772,13 +772,14 @@ static u8 *fundee_channel(struct state *state,
|
|||||||
* commitment transaction, so it can broadcast the transaction knowing
|
* commitment transaction, so it can broadcast the transaction knowing
|
||||||
* that funds can be redeemed, if need be.
|
* that funds can be redeemed, if need be.
|
||||||
*/
|
*/
|
||||||
our_commit = initial_channel_tx(state, &wscript, state->channel,
|
remote_commit = initial_channel_tx(state, &wscript, state->channel,
|
||||||
&state->next_per_commit[REMOTE], REMOTE);
|
&state->next_per_commit[REMOTE],
|
||||||
if (!our_commit)
|
REMOTE);
|
||||||
|
if (!remote_commit)
|
||||||
negotiation_failed(state,
|
negotiation_failed(state,
|
||||||
"Could not meet their fees and reserve");
|
"Could not meet their fees and reserve");
|
||||||
|
|
||||||
sign_tx_input(our_commit, 0, NULL, wscript,
|
sign_tx_input(remote_commit, 0, NULL, wscript,
|
||||||
&state->our_secrets.funding_privkey,
|
&state->our_secrets.funding_privkey,
|
||||||
our_funding_pubkey, &sig);
|
our_funding_pubkey, &sig);
|
||||||
|
|
||||||
@@ -788,7 +789,7 @@ static u8 *fundee_channel(struct state *state,
|
|||||||
|
|
||||||
return towire_opening_fundee_reply(state,
|
return towire_opening_fundee_reply(state,
|
||||||
state->remoteconf,
|
state->remoteconf,
|
||||||
their_commit,
|
local_commit,
|
||||||
&theirsig,
|
&theirsig,
|
||||||
&state->cs,
|
&state->cs,
|
||||||
&theirs.revocation,
|
&theirs.revocation,
|
||||||
|
|||||||
Reference in New Issue
Block a user