Add precondition message to Wallet.setKeyRotationTime().

This commit is contained in:
Andreas Schildbach
2015-12-05 10:42:55 +01:00
parent 1cb9002c2d
commit 4bf1bfd93a

View File

@@ -4796,7 +4796,8 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
* <p>The given time cannot be in the future.</p>
*/
public void setKeyRotationTime(long unixTimeSeconds) {
checkArgument(unixTimeSeconds <= Utils.currentTimeSeconds());
checkArgument(unixTimeSeconds <= Utils.currentTimeSeconds(), "Given time (%s) cannot be in the future.",
Utils.dateTimeFormat(unixTimeSeconds * 1000));
vKeyRotationTimestamp = unixTimeSeconds;
saveNow();
}