public class StoredPaymentChannelClientStates extends Object implements WalletExtension
StoredClientChannel
s, 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,
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.
|
BigInteger |
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.
|
String |
toString() |
protected final ReentrantLock lock
public StoredPaymentChannelClientStates(Wallet containingWallet, TransactionBroadcaster announcePeerGroup)
Wallet
and
TransactionBroadcaster
which are used to complete and announce contract and refund
transactions.@Nullable public static StoredPaymentChannelClientStates getFromWallet(Wallet wallet)
public BigInteger getBalanceForServer(Sha256Hash id)
public long getSecondsUntilExpiry(Sha256Hash id)
public String getWalletExtensionID()
WalletExtension
getWalletExtensionID
in interface WalletExtension
public boolean isWalletExtensionMandatory()
WalletExtension
isWalletExtensionMandatory
in interface WalletExtension
public byte[] serializeWalletExtension()
WalletExtension
serializeWalletExtension
in interface WalletExtension
public void deserializeWalletExtension(Wallet containingWallet, byte[] data) throws Exception
WalletExtension
deserializeWalletExtension
in interface WalletExtension
Exception
Copyright © 2014. All rights reserved.