watchtower/wtserver: add DisableReward config option
This commit is contained in:
parent
a246d8216a
commit
6504058c74
@ -54,6 +54,17 @@ func (s *Server) handleCreateSession(peer Peer, id *wtdb.SessionID,
|
||||
)
|
||||
}
|
||||
|
||||
// If the request asks for a reward session and the tower has them
|
||||
// disabled, we will reject the request.
|
||||
if s.cfg.DisableReward && req.BlobType.Has(blob.FlagReward) {
|
||||
log.Debugf("Rejecting CreateSession from %s, reward "+
|
||||
"sessions disabled", id)
|
||||
return s.replyCreateSession(
|
||||
peer, id, wtwire.CreateSessionCodeRejectBlobType, 0,
|
||||
nil,
|
||||
)
|
||||
}
|
||||
|
||||
// Now that we've established that this session does not exist in the
|
||||
// database, retrieve the sweep address that will be given to the
|
||||
// client. This address is to be included by the client when signing
|
||||
|
@ -63,6 +63,10 @@ type Config struct {
|
||||
// NoAckUpdates causes the server to not acknowledge state updates, this
|
||||
// should only be used for testing.
|
||||
NoAckUpdates bool
|
||||
|
||||
// DisableReward causes the server to reject any session creation
|
||||
// attempts that request rewards.
|
||||
DisableReward bool
|
||||
}
|
||||
|
||||
// Server houses the state required to handle watchtower peers. It's primary job
|
||||
|
Loading…
Reference in New Issue
Block a user