1

我想根据私钥获取比特币钱包的余额。我的钱包里有 0.0000155 BTC。但是下面的代码总是返回“你有 0 个比特币”。我的代码有什么问题?

final WalletAppKit kit 
    = new WalletAppKit(MainNetParams.get(), new File("."), "test");
kit.startAsync();
kit.awaitRunning();

byte[] key = Base58.decode("MY0PRIVATE0KEY0DUMMYwz8ntrXngmQrhpPig9jj9hHwsLdoej");
kit.wallet().importKey(ECKey.fromPrivate(key));

System.out.println("You have : " + kit.wallet().getBalance() + " bitcoins");
4

0 回答 0