lnwallet: update MaxHTLCNumber to precisely match the spec

This commit is contained in:
Olaoluwa Osuntokun 2017-07-29 18:22:11 -07:00
parent 71e47283cf
commit 4e4375513d
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
1 changed files with 7 additions and 6 deletions

View File

@ -106,12 +106,6 @@ const (
// HTLCWeight 172 weight
HTLCWeight = blockchain.WitnessScaleFactor * HTLCSize
// MaxHTLCNumber shows as the maximum number HTLCs which can be
// included in commitment transaction. This numbers was calculated by
// Rusty Russel in "BOLT #5: Recommendations for On-chain Transaction
// Handling", based on the fact that we need to sweep all HTLCs within
// one penalty transaction.
MaxHTLCNumber = 1253
// HtlcTimeoutWeight is the weight of the HTLC timeout transaction
// which will transition an outgoing HTLC to the delay-and-claim state.
HtlcTimeoutWeight = 663
@ -119,6 +113,13 @@ const (
// HtlcSuccessWeight is the weight of the HTLC success transaction
// which will transition an incoming HTLC to the delay-and-claim state.
HtlcSuccessWeight = 703
// MaxHTLCNumber is the maximum number HTLCs which can be included in a
// commitment transaction. This limit was chosen such that, in the case
// of a contract breach, the punishment transaction is able to sweep
// all the HTLC's yet still remain below the widely used standard
// weight limits.
MaxHTLCNumber = 967
)
// estimateCommitTxWeight estimate commitment transaction weight depending on