mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-11 17:58:01 +01: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:
parent
b28204b6ca
commit
b74d1e32a2
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue