channeldb: remove EncryptorDecryptor interface
This commit removes the EncryptorDecryptor interface, and all related usage within channeldb. This interface is no longer needed as wallet specific secrets such as private keys are no longer stored within the database.
This commit is contained in:
1 parent
a28c011b0b
commit
dc00514c42
3 files changed
+12
-52
No files matched your search
+1
-17
@@ -27,14 +27,6 @@ var bufPool = &sync.Pool{
|
||||
New: func() interface{} { return new(bytes.Buffer) },
|
||||
}
|
||||
|
||||
// EncryptorDecryptor...
|
||||
// TODO(roasbeef): ability to rotate EncryptorDecryptor's across DB
|
||||
type EncryptorDecryptor interface {
|
||||
Encrypt(in []byte) ([]byte, error)
|
||||
Decrypt(in []byte) ([]byte, error)
|
||||
OverheadSize() uint32
|
||||
}
|
||||
|
||||
// DB is the primary datastore for the LND daemon. The database stores
|
||||
// information related to nodes, routing data, open/closed channels, fee
|
||||
// schedules, and reputation data.
|
||||
@@ -42,8 +34,6 @@ type DB struct {
|
||||
store *bolt.DB
|
||||
|
||||
netParams *chaincfg.Params
|
||||
|
||||
cryptoSystem EncryptorDecryptor
|
||||
}
|
||||
|
||||
// Open opens an existing channeldb created under the passed namespace with
|
||||
@@ -66,12 +56,6 @@ func Open(dbPath string, netParams *chaincfg.Params) (*DB, error) {
|
||||
return &DB{store: bdb, netParams: netParams}, nil
|
||||
}
|
||||
|
||||
// RegisterCryptoSystem registers an implementation of the EncryptorDecryptor
|
||||
// interface for use within the database to encrypt/decrypt sensitive data.
|
||||
func (d *DB) RegisterCryptoSystem(ed EncryptorDecryptor) {
|
||||
d.cryptoSystem = ed
|
||||
}
|
||||
|
||||
// Wipe completely deletes all saved state within all used buckets within the
|
||||
// database. The deletion is done in a single transaction, therefore this
|
||||
// operation is fully atomic.
|
||||
@@ -179,7 +163,7 @@ func (d *DB) FetchOpenChannels(nodeID *wire.ShaHash) ([]*OpenChannel, error) {
|
||||
}
|
||||
|
||||
oChannel, err := fetchOpenChannel(openChanBucket,
|
||||
nodeChanBucket, chanID, d.cryptoSystem)
|
||||
nodeChanBucket, chanID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user