mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
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:
parent
ae6006a84e
commit
a803faadd7
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Reference in a new issue