3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-13 10:45:51 +00:00

Add readObject method to initialise listeners object which would be null in case the confidence object gets created from Serialisation

This commit is contained in:
Manfred Karrer 2015-03-23 10:29:47 +01:00
parent b28204b6ca
commit b74d1e32a2

View File

@ -140,6 +140,14 @@ public class TransactionConfidence implements Serializable {
this.hash = hash;
}
/**
* In case the class gets created from a serialised version, we need to recreate the listeners object as it is set as transient and only created in the constructor.
*/
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
listeners = new CopyOnWriteArrayList<ListenerRegistration<Listener>>();
}
/**
* <p>A confidence listener is informed when the level of {@link TransactionConfidence} is updated by something, like
* for example a {@link Wallet}. You can add listeners to update your user interface or manage your order tracking