diff --git a/teku/src/main/java/tech/pegasys/teku/cli/subcommand/debug/DebugDbCommand.java b/teku/src/main/java/tech/pegasys/teku/cli/subcommand/debug/DebugDbCommand.java index 8683570a905..2abc3a0e393 100644 --- a/teku/src/main/java/tech/pegasys/teku/cli/subcommand/debug/DebugDbCommand.java +++ b/teku/src/main/java/tech/pegasys/teku/cli/subcommand/debug/DebugDbCommand.java @@ -94,11 +94,13 @@ public int getDeposits( @Mixin final BeaconNodeDataOptions beaconNodeDataOptions, @Mixin final Eth2NetworkOptions eth2NetworkOptions) throws Exception { - try (final YamlEth1EventsChannel eth1EventsChannel = new YamlEth1EventsChannel(System.out); - final Database database = createDatabase(beaconNodeDataOptions, eth2NetworkOptions)) { + final YamlEth1EventsChannel eth1EventsChannel = new YamlEth1EventsChannel(System.out); + try (final Database database = createDatabase(beaconNodeDataOptions, eth2NetworkOptions)) { final DepositStorage depositStorage = DepositStorage.create(eth1EventsChannel, database, false); depositStorage.replayDepositEvents().join(); + } finally { + eth1EventsChannel.close(); } return 0; }