watchtower/wtserver/server: no ack updates
This commit is contained in:
1 file changed
+11
@@ -55,6 +55,10 @@ type Config struct {
|
|||||||
|
|
||||||
// ChainHash identifies the network that the server is watching.
|
// ChainHash identifies the network that the server is watching.
|
||||||
ChainHash chainhash.Hash
|
ChainHash chainhash.Hash
|
||||||
|
|
||||||
|
// NoAckUpdates causes the server to not acknowledge state updates, this
|
||||||
|
// should only be used for testing.
|
||||||
|
NoAckUpdates bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server houses the state required to handle watchtower peers. It's primary job
|
// Server houses the state required to handle watchtower peers. It's primary job
|
||||||
@@ -445,6 +449,13 @@ func (s *Server) handleStateUpdate(peer Peer, id *wtdb.SessionID,
|
|||||||
failCode = wtwire.CodeTemporaryFailure
|
failCode = wtwire.CodeTemporaryFailure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.cfg.NoAckUpdates {
|
||||||
|
return &connFailure{
|
||||||
|
ID: *id,
|
||||||
|
Code: uint16(failCode),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return s.replyStateUpdate(
|
return s.replyStateUpdate(
|
||||||
peer, id, failCode, lastApplied,
|
peer, id, failCode, lastApplied,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user