public class PaymentChannelV2ClientState extends PaymentChannelClientState
PaymentChannelClientState.IncrementedPayment, PaymentChannelClientState.State
stateMachine, storedChannel, valueToMe
Constructor and Description |
---|
PaymentChannelV2ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds) |
Modifier and Type | Method and Description |
---|---|
Transaction |
getContract()
Gets the contract which was used to initialize this channel
|
protected Transaction |
getContractInternal()
Gets the contract without changing the state machine
|
protected Script |
getContractScript() |
protected long |
getExpiryTime() |
int |
getMajorVersion() |
Coin |
getRefundTxFees()
Returns the fees that will be paid if the refund transaction has to be claimed because the server failed to settle
the channel properly.
|
protected Script |
getSignedScript()
Gets the script that is signed.
|
protected com.google.common.collect.Multimap<PaymentChannelClientState.State,PaymentChannelClientState.State> |
getStateTransitions() |
Coin |
getTotalValue()
Gets the total value of this channel (ie the maximum payment possible)
|
protected Coin |
getValueToMe() |
void |
initiate(org.bouncycastle.crypto.params.KeyParameter userKey,
IPaymentChannelClient.ClientChannelProperties clientChannelProperties)
Creates the initial multisig contract and incomplete refund transaction which can be requested at the appropriate
time using
PaymentChannelV1ClientState.getIncompleteRefundTransaction() and
PaymentChannelClientState.getContract() . |
checkNotExpired, disconnectFromChannel, getState, getValueRefunded, getValueSpent, incrementPaymentBy, initiate, initWalletListeners, isSettlementTransaction, storeChannelInWallet, updateChannelInWallet, watchCloseConfirmations
public PaymentChannelV2ClientState(Wallet wallet, ECKey myKey, ECKey serverMultisigKey, Coin value, long expiryTimeInSeconds) throws VerificationException
VerificationException
protected com.google.common.collect.Multimap<PaymentChannelClientState.State,PaymentChannelClientState.State> getStateTransitions()
getStateTransitions
in class PaymentChannelClientState
public int getMajorVersion()
getMajorVersion
in class PaymentChannelClientState
public void initiate(@Nullable org.bouncycastle.crypto.params.KeyParameter userKey, IPaymentChannelClient.ClientChannelProperties clientChannelProperties) throws ValueOutOfRangeException, InsufficientMoneyException
PaymentChannelClientState
PaymentChannelV1ClientState.getIncompleteRefundTransaction()
and
PaymentChannelClientState.getContract()
.
By default unconfirmed coins are allowed to be used, as for micropayments the risk should be relatively low.initiate
in class PaymentChannelClientState
userKey
- Key derived from a user password, needed for any signing when the wallet is encrypted.
The wallet KeyCrypter is assumed.clientChannelProperties
- Modify the channel's configuration.ValueOutOfRangeException
- if the value being used is too small to be accepted by the networkInsufficientMoneyException
- if the wallet doesn't contain enough balance to initiateprotected Coin getValueToMe()
getValueToMe
in class PaymentChannelClientState
protected long getExpiryTime()
getExpiryTime
in class PaymentChannelClientState
public Transaction getContract()
PaymentChannelClientState
getContract
in class PaymentChannelClientState
protected Transaction getContractInternal()
PaymentChannelClientState
getContractInternal
in class PaymentChannelClientState
protected Script getContractScript()
getContractScript
in class PaymentChannelClientState
protected Script getSignedScript()
PaymentChannelClientState
getSignedScript
in class PaymentChannelClientState
public Coin getRefundTxFees()
PaymentChannelClientState
PaymentChannelClientState.initiate(KeyParameter, IPaymentChannelClient.ClientChannelProperties)
getRefundTxFees
in class PaymentChannelClientState
public Coin getTotalValue()
PaymentChannelClientState
getTotalValue
in class PaymentChannelClientState