mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: fix make fmt
This commit is contained in:
@@ -111,19 +111,18 @@ func newIndex(v uint64) index {
|
||||
// 6. 2(0b010) -> 2, 3
|
||||
// 7. 1(0b001) -> 1
|
||||
//
|
||||
// ^ bucket number
|
||||
// |
|
||||
// 3 | x
|
||||
// | |
|
||||
// 2 | | x
|
||||
// | | |
|
||||
// 1 | | x | x
|
||||
// | | | | |
|
||||
// 0 | | x | x | x | x
|
||||
// | | | | | | | | |
|
||||
// +---|---|---|---|---|---|---|---|---> index
|
||||
// 0 1 2 3 4 5 6 7
|
||||
//
|
||||
// ^ bucket number
|
||||
// |
|
||||
// 3 | x
|
||||
// | |
|
||||
// 2 | | x
|
||||
// | | |
|
||||
// 1 | | x | x
|
||||
// | | | | |
|
||||
// 0 | | x | x | x | x
|
||||
// | | | | | | | | |
|
||||
// +---|---|---|---|---|---|---|---|---> index
|
||||
// 0 1 2 3 4 5 6 7
|
||||
func (from index) deriveBitTransformations(to index) ([]uint8, error) {
|
||||
var positions []uint8
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@ import (
|
||||
// bitsToIndex is a helper function which takes 'n' last bits as input and
|
||||
// create shachain index.
|
||||
// Example:
|
||||
// Input: 0,1,1,0,0
|
||||
// Output: 0b000000000000000000000000000000000000000[01100] == 12
|
||||
//
|
||||
// Input: 0,1,1,0,0
|
||||
// Output: 0b000000000000000000000000000000000000000[01100] == 12
|
||||
func bitsToIndex(bs ...uint64) (index, error) {
|
||||
if len(bs) > 64 {
|
||||
return 0, errors.New("number of elements should be lower then" +
|
||||
|
||||
Reference in New Issue
Block a user