public class StoredPaymentChannelClientStates extends Object implements WalletExtension
StoredClientChannels, automatically (re)broadcasting the contract transaction
and broadcasting the refund transaction over the given TransactionBroadcaster.| Modifier and Type | Field and Description |
|---|---|
protected ReentrantLock |
lock |
| Constructor and Description |
|---|
StoredPaymentChannelClientStates(Wallet containingWallet)
Creates a new StoredPaymentChannelClientStates and associates it with the given
Wallet
Use this constructor if you use WalletAppKit, it will provide the broadcaster for you (no need to call the setter) |
StoredPaymentChannelClientStates(Wallet containingWallet,
TransactionBroadcaster announcePeerGroup)
Creates a new StoredPaymentChannelClientStates and associates it with the given
Wallet and
TransactionBroadcaster which are used to complete and announce contract and refund
transactions. |
| Modifier and Type | Method and Description |
|---|---|
void |
deserializeWalletExtension(Wallet containingWallet,
byte[] data)
Loads the contents of this object from the wallet.
|
Coin |
getBalanceForServer(Sha256Hash id)
Returns the outstanding amount of money sent back to us for all channels to this server added together.
|
static StoredPaymentChannelClientStates |
getFromWallet(Wallet wallet)
Returns this extension from the given wallet, or null if no such extension was added.
|
long |
getSecondsUntilExpiry(Sha256Hash id)
Returns the number of seconds from now until this servers next channel will expire, or zero if no unexpired
channels found.
|
String |
getWalletExtensionID()
Returns a Java package/class style name used to disambiguate this extension from others.
|
boolean |
isWalletExtensionMandatory()
If this returns true, the mandatory flag is set when the wallet is serialized and attempts to load it without
the extension being in the wallet will throw an exception.
|
byte[] |
serializeWalletExtension()
Returns bytes that will be saved in the wallet.
|
void |
setTransactionBroadcaster(TransactionBroadcaster transactionBroadcaster)
Use this setter if the broadcaster is not available during instantiation and you're not using WalletAppKit.
|
String |
toString() |
protected final ReentrantLock lock
public StoredPaymentChannelClientStates(@Nullable Wallet containingWallet, TransactionBroadcaster announcePeerGroup)
Wallet and
TransactionBroadcaster which are used to complete and announce contract and refund
transactions.public StoredPaymentChannelClientStates(@Nullable Wallet containingWallet)
Wallet
Use this constructor if you use WalletAppKit, it will provide the broadcaster for you (no need to call the setter)public void setTransactionBroadcaster(TransactionBroadcaster transactionBroadcaster)
transactionBroadcaster - which is used to complete and announce contract and refund transactions.@Nullable public static StoredPaymentChannelClientStates getFromWallet(Wallet wallet)
public Coin getBalanceForServer(Sha256Hash id)
public long getSecondsUntilExpiry(Sha256Hash id)
public String getWalletExtensionID()
WalletExtensiongetWalletExtensionID in interface WalletExtensionpublic boolean isWalletExtensionMandatory()
WalletExtensionisWalletExtensionMandatory in interface WalletExtensionpublic byte[] serializeWalletExtension()
WalletExtensionserializeWalletExtension in interface WalletExtensionpublic void deserializeWalletExtension(Wallet containingWallet, byte[] data) throws Exception
WalletExtensiondeserializeWalletExtension in interface WalletExtensionExceptionCopyright © 2015. All rights reserved.