From 3d7c1a504ee390dcd491a404d5ab1df7f875a664 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Sun, 31 Jan 2016 23:13:35 +0100 Subject: [PATCH] Never delete the private key --- .../dissem/apps/abit/repository/AndroidAddressRepository.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java index edbdbe8..1e51643 100644 --- a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java +++ b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java @@ -196,7 +196,9 @@ public class AndroidAddressRepository implements AddressRepository { } else { values.put(COLUMN_PUBLIC_KEY, (byte[]) null); } - values.put(COLUMN_PRIVATE_KEY, Encode.bytes(address.getPrivateKey())); + if (address.getPrivateKey() != null) { + values.put(COLUMN_PRIVATE_KEY, Encode.bytes(address.getPrivateKey())); + } values.put(COLUMN_SUBSCRIBED, address.isSubscribed()); int update = db.update(TABLE_NAME, values, "address = '" + address.getAddress() +