mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 08:02:25 +02:00
watchtower/wtdb: apply sanity checks to session policy before accepting
This commit is contained in:
@@ -81,6 +81,11 @@ func (db *TowerDB) InsertSessionInfo(info *wtdb.SessionInfo) error {
|
||||
return wtdb.ErrSessionAlreadyExists
|
||||
}
|
||||
|
||||
// Perform a quick sanity check on the session policy before accepting.
|
||||
if err := info.Policy.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
db.sessions[info.ID] = info
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user