mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-01 21:17:13 +00:00
Serialize key creation time.
Resolves issue 151.
This commit is contained in:
@@ -100,7 +100,7 @@ public class WalletProtobufSerializer {
|
||||
for (ECKey key : wallet.getKeys()) {
|
||||
walletBuilder.addKey(
|
||||
Protos.Key.newBuilder()
|
||||
// .setCreationTimestamp() TODO
|
||||
.setCreationTimestamp(key.getCreationTimeSeconds() * 1000)
|
||||
// .setLabel() TODO
|
||||
.setType(Protos.Key.Type.ORIGINAL)
|
||||
.setPrivateKey(ByteString.copyFrom(key.getPrivKeyBytes()))
|
||||
@@ -231,7 +231,9 @@ public class WalletProtobufSerializer {
|
||||
}
|
||||
|
||||
byte[] pubKey = keyProto.hasPublicKey() ? keyProto.getPublicKey().toByteArray() : null;
|
||||
wallet.addKey(new ECKey(keyProto.getPrivateKey().toByteArray(), pubKey));
|
||||
ECKey ecKey = new ECKey(keyProto.getPrivateKey().toByteArray(), pubKey);
|
||||
ecKey.setCreationTimeSeconds((keyProto.getCreationTimestamp() + 500) / 1000);
|
||||
wallet.addKey(ecKey);
|
||||
}
|
||||
|
||||
// Read all transactions and create outputs
|
||||
|
||||
Reference in New Issue
Block a user