2015-12-16 23:39:05 +03:00
|
|
|
package revocation
|
2015-11-19 01:59:51 +03:00
|
|
|
|
2015-12-16 23:51:59 +03:00
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/btcsuite/btcd/wire"
|
|
|
|
)
|
2015-11-19 01:59:51 +03:00
|
|
|
|
|
|
|
// chainFragment...
|
|
|
|
type chainFragment struct {
|
|
|
|
index uint64
|
|
|
|
hash wire.ShaHash
|
|
|
|
}
|
|
|
|
|
2015-12-16 23:43:59 +03:00
|
|
|
// HyperShaChain...
|
2015-12-16 23:49:01 +03:00
|
|
|
// * https://github.com/rustyrussell/ccan/blob/master/ccan/crypto/shachain/design.txt
|
2015-12-16 23:43:59 +03:00
|
|
|
type HyperShaChain struct {
|
2015-12-16 23:51:59 +03:00
|
|
|
sync.RWMutex
|
|
|
|
|
2015-11-19 01:59:51 +03:00
|
|
|
lastChainIndex uint64
|
|
|
|
|
|
|
|
chainFragments []chainFragment
|
|
|
|
}
|
|
|
|
|
2015-12-16 23:43:59 +03:00
|
|
|
// NewHyperShaChain...
|
|
|
|
func NewHyperShaChain(seed wire.ShaHash) *HyperShaChain {
|
2015-11-19 01:59:51 +03:00
|
|
|
// TODO(roasbeef): from/to or static size?
|
2015-12-16 23:39:05 +03:00
|
|
|
return nil
|
2015-11-19 01:59:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// NextHash...
|
2015-12-16 23:43:59 +03:00
|
|
|
func (s *HyperShaChain) NextHash() {
|
2015-11-19 01:59:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetHash...
|
2015-12-16 23:43:59 +03:00
|
|
|
func (s *HyperShaChain) GetHash(index uint64) {
|
2015-11-19 01:59:51 +03:00
|
|
|
}
|