@@ -28,6 +28,8 @@ func getSessionKey(session *Session) []byte {
28
28
// StoreSession stores a session in the store. If a session with the
29
29
// same local public key already exists, the existing record is updated/
30
30
// overwritten instead.
31
+ //
32
+ // NOTE: this is part of the Store interface.
31
33
func (db * DB ) StoreSession (session * Session ) error {
32
34
var buf bytes.Buffer
33
35
if err := SerializeSession (& buf , session ); err != nil {
@@ -46,6 +48,8 @@ func (db *DB) StoreSession(session *Session) error {
46
48
}
47
49
48
50
// GetSession fetches the session with the given key.
51
+ //
52
+ // NOTE: this is part of the Store interface.
49
53
func (db * DB ) GetSession (key * btcec.PublicKey ) (* Session , error ) {
50
54
var session * Session
51
55
err := db .View (func (tx * bbolt.Tx ) error {
@@ -74,6 +78,8 @@ func (db *DB) GetSession(key *btcec.PublicKey) (*Session, error) {
74
78
}
75
79
76
80
// ListSessions returns all sessions currently known to the store.
81
+ //
82
+ // NOTE: this is part of the Store interface.
77
83
func (db * DB ) ListSessions (filterFn func (s * Session ) bool ) ([]* Session , error ) {
78
84
var sessions []* Session
79
85
err := db .View (func (tx * bbolt.Tx ) error {
@@ -112,6 +118,8 @@ func (db *DB) ListSessions(filterFn func(s *Session) bool) ([]*Session, error) {
112
118
113
119
// RevokeSession updates the state of the session with the given local
114
120
// public key to be revoked.
121
+ //
122
+ // NOTE: this is part of the Store interface.
115
123
func (db * DB ) RevokeSession (key * btcec.PublicKey ) error {
116
124
var session * Session
117
125
err := db .View (func (tx * bbolt.Tx ) error {
0 commit comments