mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-17 04:47:28 +00:00
Copy accessor for the channel map
This commit is contained in:
committed by
Andreas Schildbach
parent
ff2e057126
commit
3966f424a0
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.protocols.channels;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.bitcoinj.core.*;
|
||||
import org.bitcoinj.utils.Threading;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
@@ -149,6 +150,18 @@ public class StoredPaymentChannelServerStates implements WalletExtension {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a copy of all {@link StoredServerChannel}s
|
||||
*/
|
||||
public Map<Sha256Hash, StoredServerChannel> getChannelMap() {
|
||||
lock.lock();
|
||||
try {
|
||||
return ImmutableMap.copyOf(mapChannels);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies the set of stored states that a channel has been updated. Use to notify the wallet of an update to this
|
||||
* wallet extension.
|
||||
|
||||
Reference in New Issue
Block a user