mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Set wasTruncated flag at GetDataResponse
If we truncated dateSortedTruncatablePayloads we set outTruncated flag to true (used for trade statistics)
This commit is contained in:
parent
c40d4ffffa
commit
c4467ce03b
@ -349,11 +349,13 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
|
||||
.map(e -> get32ByteHashAsByteArray((e.getProtectedStoragePayload())))
|
||||
.toArray());
|
||||
|
||||
boolean wasTruncated = wasPersistableNetworkPayloadsTruncated.get() || wasProtectedStorageEntriesTruncated.get();
|
||||
return new GetDataResponse(
|
||||
filteredProtectedStorageEntries,
|
||||
filteredPersistableNetworkPayloads,
|
||||
getDataRequest.getNonce(),
|
||||
getDataRequest instanceof GetUpdatedDataRequest);
|
||||
getDataRequest instanceof GetUpdatedDataRequest,
|
||||
wasTruncated);
|
||||
}
|
||||
|
||||
|
||||
@ -428,6 +430,7 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
|
||||
int fromIndex = dateSortedTruncatablePayloads.size() - maxItems;
|
||||
int toIndex = dateSortedTruncatablePayloads.size();
|
||||
dateSortedTruncatablePayloads = dateSortedTruncatablePayloads.subList(fromIndex, toIndex);
|
||||
outTruncated.set(true);
|
||||
log.info("Num truncated dateSortedTruncatablePayloads {}", dateSortedTruncatablePayloads.size());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user