aboutsummaryrefslogtreecommitdiffstats
path: root/device/peer.go
diff options
context:
space:
mode:
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/device/peer.go b/device/peer.go
index 79d4981..899591b 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -223,10 +223,10 @@ func (peer *Peer) ZeroAndFlushAll() {
keypairs.Lock()
device.DeleteKeypair(keypairs.previous)
device.DeleteKeypair(keypairs.current)
- device.DeleteKeypair(keypairs.next)
+ device.DeleteKeypair(keypairs.loadNext())
keypairs.previous = nil
keypairs.current = nil
- keypairs.next = nil
+ keypairs.storeNext(nil)
keypairs.Unlock()
// clear handshake state
@@ -254,7 +254,7 @@ func (peer *Peer) ExpireCurrentKeypairs() {
keypairs.current.sendNonce = RejectAfterMessages
}
if keypairs.next != nil {
- keypairs.next.sendNonce = RejectAfterMessages
+ keypairs.loadNext().sendNonce = RejectAfterMessages
}
keypairs.Unlock()
}