Data: Set flag bit when blinded

This commit is contained in:
zzz
2019-07-18 18:42:42 +00:00
parent 6adc665fd3
commit 7374484ccb
2 changed files with 24 additions and 2 deletions

View File

@ -401,6 +401,7 @@ public class EncryptedLeaseSet extends LeaseSet2 {
// inner LS is always unpublished
int saveFlags = _flags;
setUnpublished();
setBlindedWhenPublished();
try {
// Inner layer - type - data covered by sig
baos.write(KEY_TYPE_LS2);

View File

@ -43,8 +43,13 @@ public class LeaseSet2 extends LeaseSet {
// If this leaseset was formerly blinded, the blinded hash, so we can find it again
private Hash _blindedHash;
private static final int FLAG_OFFLINE_KEYS = 1;
private static final int FLAG_UNPUBLISHED = 2;
private static final int FLAG_OFFLINE_KEYS = 0x01;
private static final int FLAG_UNPUBLISHED = 0x02;
/**
* Set if the unencrypted LS, when published, will be blinded/encrypted
* @since 0.9.42
*/
private static final int FLAG_BLINDED = 0x04;
private static final int MAX_KEYS = 8;
public LeaseSet2() {
@ -82,6 +87,22 @@ public class LeaseSet2 extends LeaseSet {
public void setUnpublished() {
_flags |= FLAG_UNPUBLISHED;
}
/**
* Set if the unencrypted LS, when published, will be blinded/encrypted
* @since 0.9.42
*/
public boolean isBlindedWhenPublished() {
return (_flags & FLAG_BLINDED) != 0;
}
/**
* Set if the unencrypted LS, when published, will be blinded/encrypted
* @since 0.9.42
*/
public void setBlindedWhenPublished() {
_flags |= FLAG_BLINDED;
}
/**
* If true, we received this LeaseSet by a remote peer publishing it to