Browse Source

Documentation: Update to BOLT v1.0.

Mainly typo fixes, but we removed the INCORRECT_PAYMENT_AMOUNT error
altogether.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pr-2587
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
6765423393
  1. 2
      Makefile
  2. 8
      channeld/channeld.c
  3. 2
      channeld/commit_tx.c
  4. 6
      channeld/full_channel.c
  5. 4
      common/htlc_tx.c
  6. 2
      common/initial_commit_tx.c
  7. 2
      lightningd/peer_htlcs.c
  8. 1
      wire/gen_onion_wire_csv

2
Makefile

@ -15,7 +15,7 @@ CCANDIR := ccan
# Where we keep the BOLT RFCs
BOLTDIR := ../lightning-rfc/
BOLTVERSION := 3fef98d10695462edecc63cba05e4a96374f4664
BOLTVERSION := da71867c840abe057d7a68f358dd9493e0e79110
-include config.vars

8
channeld/channeld.c

@ -908,9 +908,6 @@ static u8 *make_failmsg(const tal_t *ctx,
case WIRE_INVALID_ONION_KEY:
msg = towire_invalid_onion_key(ctx, sha256);
goto done;
case WIRE_INCORRECT_PAYMENT_AMOUNT:
/* Deprecated: we should never make this any more! */
break;
}
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Asked to create failmsg %u (%s)",
@ -971,8 +968,7 @@ static secp256k1_ecdsa_signature *calc_commitsigs(const tal_t *ctx,
* A sending node:
*...
* - MUST include one `htlc_signature` for every HTLC transaction
* corresponding to BIP69 lexicographic ordering of the commitment
* transaction.
* corresponding to the ordering of the commitment transaction
*/
htlc_sigs = tal_arr(ctx, secp256k1_ecdsa_signature, tal_count(txs) - 1);
@ -2243,7 +2239,7 @@ static void peer_reconnect(struct peer *peer,
* receiving node has sent:
* - SHOULD fail the channel.
* - if it has not sent `revoke_and_ack`, AND
* `next_remote_revocation_number` is equal to 0:
* `next_remote_revocation_number` is not equal to 0:
* - SHOULD fail the channel.
*/
if (next_remote_revocation_number == peer->next_index[LOCAL] - 2) {

2
channeld/commit_tx.c

@ -269,7 +269,7 @@ struct bitcoin_tx *commit_tx(const tal_t *ctx,
/* BOLT #3:
*
* 7. Sort the outputs into [BIP 69
* 7. Sort the outputs into [BIP 69+CLTV
* order](#transaction-input-and-output-ordering)
*/
permute_outputs(tx->output, cltvs, (const void **)*htlcmap);

6
channeld/full_channel.c

@ -379,8 +379,8 @@ static enum channel_add_err add_htlc(struct channel *channel,
/* BOLT #2:
*
* - if a sending node adds more than its `max_accepted_htlcs` HTLCs to
* its local commitment transaction...
* - if a sending node adds more than receiver `max_accepted_htlcs`
* HTLCs to its local commitment transaction...
* - SHOULD fail the channel.
*/
if (tal_count(committed) - tal_count(removing) + tal_count(adding)
@ -406,7 +406,7 @@ static enum channel_add_err add_htlc(struct channel *channel,
/* BOLT #2:
*
* - if a sending node... adds more than its
* - if a sending node... adds more than receiver
* `max_htlc_value_in_flight_msat` worth of offered HTLCs to its
* local commitment transaction:
* - SHOULD fail the channel.

4
common/htlc_tx.c

@ -23,8 +23,8 @@ static struct bitcoin_tx *htlc_tx(const tal_t *ctx,
* ## HTLC-Timeout and HTLC-Success Transactions
*
* These HTLC transactions are almost identical, except the
* HTLC-timeout transaction is timelocked. The HTLC-timeout
* transaction is also the transaction that can be spent by a valid
* HTLC-timeout transaction is timelocked. Both
* HTLC-timeout/HTLC-success transactions can be spent by a valid
* penalty transaction.
*/

2
common/initial_commit_tx.c

@ -196,7 +196,7 @@ struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
/* BOLT #3:
*
* 7. Sort the outputs into [BIP 69
* 7. Sort the outputs into [BIP 69+CLTV
* order](#transaction-input-and-output-ordering)
*/
permute_outputs(tx->output, NULL, NULL);

2
lightningd/peer_htlcs.c

@ -317,7 +317,7 @@ static void handle_localpay(struct htlc_in *hin,
*
* - if the amount paid is more than twice the amount expected:
* - SHOULD fail the HTLC.
* - SHOULD return an `incorrect_payment_amount` error.
* - SHOULD return an `incorrect_or_unknown_payment_details` error.
*/
failcode = WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS;
goto fail;

1
wire/gen_onion_wire_csv

@ -32,7 +32,6 @@ expiry_too_soon,0,len,2
expiry_too_soon,2,channel_update,len
incorrect_or_unknown_payment_details,PERM|15
incorrect_or_unknown_payment_details,0,htlc_msat,8
incorrect_payment_amount,PERM|16
final_expiry_too_soon,17
final_incorrect_cltv_expiry,18
final_incorrect_cltv_expiry,0,cltv_expiry,4

Loading…
Cancel
Save