From bd3fff459c132f37293f8188ddb8e58533d06fea Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Thu, 3 Aug 2023 23:18:07 +0200 Subject: [PATCH 1/2] Use default hash function for 20 bit hashes --- contract/src/main/java/bisq/contract/ContractService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract/src/main/java/bisq/contract/ContractService.java b/contract/src/main/java/bisq/contract/ContractService.java index 2f313a3242..5b9c19f629 100644 --- a/contract/src/main/java/bisq/contract/ContractService.java +++ b/contract/src/main/java/bisq/contract/ContractService.java @@ -77,7 +77,7 @@ public CompletableFuture shutdown() { } private > byte[] getContractHash(Contract contract) { - return DigestUtil.sha256(contract.getHashForSignature()); + return DigestUtil.hash(contract.getHashForSignature()); } } \ No newline at end of file From 20553dea78a1d940869445bc5ce854dfdfe3bb1a Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Thu, 3 Aug 2023 23:18:17 +0200 Subject: [PATCH 2/2] Change validation --- .../main/java/bisq/trade/protocol/messages/TradeMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java b/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java index 77fed858d1..b7f268f12c 100644 --- a/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java +++ b/trade/src/main/java/bisq/trade/protocol/messages/TradeMessage.java @@ -46,7 +46,7 @@ protected TradeMessage(String tradeId, NetworkId sender) { this.tradeId = tradeId; this.sender = sender; - NetworkDataValidation.validateId(tradeId); + NetworkDataValidation.validateText(tradeId, 200); // For private channels we combine user profile IDs for channelId } public bisq.trade.protobuf.TradeMessage.Builder getTradeMessageBuilder() {