edits
[iotcloud.git] / src / java / iotcloud / Slot.java
index ea30ddbe93658c8d6642d1b0cfdb321442855a44..9de69db52d06dd09f786f15a2fc0e9cfce917c52 100644 (file)
@@ -30,11 +30,11 @@ class Slot implements Liveness {
        }
 
        Slot(long _seqnum, long _machineid, byte[] _prevhmac) {
-               this(_seqnum, _machineid, _prevhmac, new byte[HMAC_SIZE]);
+               this(_seqnum, _machineid, _prevhmac, null);
        }
 
        Slot(long _seqnum, long _machineid) {
-               this(_seqnum, _machineid, new byte[HMAC_SIZE], new byte[HMAC_SIZE]);
+               this(_seqnum, _machineid, new byte[HMAC_SIZE], null);
        }
 
        byte[] getHMAC() {
@@ -103,6 +103,7 @@ class Slot implements Liveness {
                //Compute our HMAC
                mac.update(array, HMAC_SIZE, array.length-HMAC_SIZE);
                byte[] realmac=mac.doFinal();
+               hmac = realmac;
                bb.position(0);
                bb.put(realmac);
                return array;
@@ -132,10 +133,6 @@ class Slot implements Liveness {
                return machineid;
        }
 
-       byte[] getBytes() {
-               return null;
-       }
-
        void setDead() {
                decrementLiveCount();
                seqnumlive=false;
@@ -150,6 +147,6 @@ class Slot implements Liveness {
        }
 
        public String toString() {
-               return "<"+getSequenceNumber()+", "+new String(getBytes())+">";
+               return "<"+getSequenceNumber()+">";
        }
 }