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 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.spongycastle.crypto.params.KeyParameter userKey)
Creates the initial multisig contract and incomplete refund transaction which can be requested at the appropriate
time using
PaymentChannelV1ClientState.getIncompleteRefundTransaction() and
PaymentChannelV1ClientState.getContract() . |
checkNotExpired, disconnectFromChannel, editContractSendRequest, 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 Multimap<PaymentChannelClientState.State,PaymentChannelClientState.State> getStateTransitions()
getStateTransitions
in class PaymentChannelClientState
public int getMajorVersion()
getMajorVersion
in class PaymentChannelClientState
public void initiate(@Nullable org.spongycastle.crypto.params.KeyParameter userKey) throws ValueOutOfRangeException, InsufficientMoneyException
PaymentChannelClientState
PaymentChannelV1ClientState.getIncompleteRefundTransaction()
and
PaymentChannelV1ClientState.getContract()
. The way the contract is crafted can be adjusted by
overriding PaymentChannelV1ClientState#editContractSendRequest(org.bitcoinj.wallet.Wallet.SendRequest)
.
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.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()
getRefundTxFees
in class PaymentChannelClientState
public Coin getTotalValue()
PaymentChannelClientState
getTotalValue
in class PaymentChannelClientState
Copyright © 2016. All rights reserved.