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