Skip to content

Commit

Permalink
The block variable was keeping too much memory while waiting for futu…
Browse files Browse the repository at this point in the history
…re to finish (hyperledger#4489)

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
  • Loading branch information
gezero authored and eum602 committed Nov 3, 2023
1 parent cf8004d commit 5d849b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)

final var block =
new Block(newBlockHeader, new BlockBody(transactions, Collections.emptyList()));
final String warningMessage = "Sync to block " + block.toLogString() + " failed";

if (mergeContext.get().isSyncing() || parentHeader.isEmpty()) {
LOG.debug(
Expand All @@ -187,8 +188,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
.appendNewPayloadToSync(block)
.exceptionally(
exception -> {
LOG.warn(
"Sync to block " + block.toLogString() + " failed", exception.getMessage());
LOG.warn(warningMessage, exception.getMessage());
return null;
});
return respondWith(reqId, blockParam, null, SYNCING);
Expand Down

0 comments on commit 5d849b9

Please sign in to comment.