(WIP) implement LMDB peer storage

todo: GC
This commit is contained in:
Lawrence, Rendall
2024-06-14 18:56:44 +03:00
parent 2adbb5f8c7
commit b92c9103b9
6 changed files with 346 additions and 38 deletions

View File

@@ -26,8 +26,6 @@ var ErrInvalidPeerIDSize = fmt.Errorf("peer ID must be %d bytes", PeerIDLen)
var zeroPeerID PeerID
// NewPeerID creates a PeerID from a byte slice.
//
// It panics if b is not 20 bytes long.
func NewPeerID(b []byte) (PeerID, error) {
if len(b) != PeerIDLen {
return zeroPeerID, ErrInvalidPeerIDSize