shachain: use maxHeight+1 for bucket key space

This prevents a nil-pointer-dereference if we hit 2^48 channel states.
This commit is contained in:
eugene 2022-11-02 13:06:47 -04:00
parent ae6006a84e
commit a803faadd7
No known key found for this signature in database
GPG key ID: 118759E83439A9B1

View file

@ -46,7 +46,7 @@ type RevocationStore struct {
// buckets is an array of elements from which we may derive all // buckets is an array of elements from which we may derive all
// previous elements, each bucket corresponds to the element with the // previous elements, each bucket corresponds to the element with the
// particular number of trailing zeros. // particular number of trailing zeros.
buckets [maxHeight]element buckets [maxHeight + 1]element
// index is an available index which will be assigned to the new // index is an available index which will be assigned to the new
// element. // element.