You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess I'm too late, but if anybody faces it again:
In BitcoinJ loadFromFile() and loadFromFileStream() use NetworkParameters.fromId() which is static. It's only aware of BTC IDs and thus returns null for all others.
The option I used is to create own instance of WalletProtobufSerializer and pass parameters inside directly:
try (InputStream in = new FileInputStream("yourFile")) {
Protos.Wallet walletProto = WalletProtobufSerializer.parseToProto(in);
WalletProtobufSerializer serializer = new WalletProtobufSerializer();
Wallet yourWallet = serializer.readWallet(params, null, walletProto);
}
I get this error
[18:33:19] [Server thread/WARN]: org.bitcoinj.wallet.UnreadableWalletException: Unknown network parameters ID org.dogecoin.production [18:33:19] [Server thread/WARN]: at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:416) [18:33:19] [Server thread/WARN]: at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:391) [18:33:19] [Server thread/WARN]: at org.bitcoinj.wallet.Wallet.loadFromFileStream(Wallet.java:1606) [18:33:19] [Server thread/WARN]: at org.bitcoinj.wallet.Wallet.loadFromFile(Wallet.java:1512) [18:33:19] [Server thread/WARN]: at net.waals.dogecraft.DogeCraft.onEnable(DogeCraft.java:29) [18:33:19] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) [18:33:19] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:352) [18:33:19] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:417) [18:33:19] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:462) [18:33:19] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:376) [18:33:19] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.reload(CraftServer.java:811) [18:33:19] [Server thread/WARN]: at org.bukkit.Bukkit.reload(Bukkit.java:576) [18:33:19] [Server thread/WARN]: at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) [18:33:19] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) [18:33:19] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:711) [18:33:19] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchServerCommand(CraftServer.java:696) [18:33:19] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.DedicatedServer.handleCommandQueue(DedicatedServer.java:436) [18:33:19] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:400) [18:33:19] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:984) [18:33:19] [Server thread/WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:824) [18:33:19] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:834)
The text was updated successfully, but these errors were encountered: