public class PaymentChannelV2ServerState extends PaymentChannelServerState
PaymentChannelServerState.State
Modifier and Type | Field and Description |
---|---|
protected ECKey |
clientKey |
bestValueSignature, bestValueToMe, broadcaster, contract, minExpireTime, serverKey, stateMachine, storedServerChannel
Constructor and Description |
---|
PaymentChannelV2ServerState(TransactionBroadcaster broadcaster,
Wallet wallet,
ECKey serverKey,
long minExpireTime) |
Modifier and Type | Method and Description |
---|---|
ListenableFuture<Transaction> |
close()
Closes this channel and broadcasts the highest value payment transaction on the network.
|
protected Script |
createOutputScript()
Creates a P2SH script outputting to the client and server pubkeys
|
protected ECKey |
getClientKey() |
TransactionOutput |
getClientOutput() |
Coin |
getFeePaid()
Gets the fee paid in the final payment transaction (only available if settle() did not throw an exception)
|
int |
getMajorVersion() |
protected Script |
getSignedScript()
Gets the script that signatures should sign against.
|
Multimap<PaymentChannelServerState.State,PaymentChannelServerState.State> |
getStateTransitions() |
void |
provideClientKey(byte[] clientKey) |
protected void |
verifyContract(Transaction contract)
Verifies that the given contract meets a set of extra requirements
|
getBestValueToMe, getContract, getContractScript, getExpiryTime, getState, getTotalValue, incrementPayment, makeUnsignedChannelContract, provideContract, storeChannelInWallet, updateChannelInWallet
protected ECKey clientKey
public PaymentChannelV2ServerState(TransactionBroadcaster broadcaster, Wallet wallet, ECKey serverKey, long minExpireTime)
public Multimap<PaymentChannelServerState.State,PaymentChannelServerState.State> getStateTransitions()
getStateTransitions
in class PaymentChannelServerState
public int getMajorVersion()
getMajorVersion
in class PaymentChannelServerState
public TransactionOutput getClientOutput()
getClientOutput
in class PaymentChannelServerState
public void provideClientKey(byte[] clientKey)
public Coin getFeePaid()
PaymentChannelServerState
getFeePaid
in class PaymentChannelServerState
protected Script getSignedScript()
PaymentChannelServerState
getSignedScript
in class PaymentChannelServerState
protected void verifyContract(Transaction contract)
PaymentChannelServerState
verifyContract
in class PaymentChannelServerState
protected Script createOutputScript()
createOutputScript
in class PaymentChannelServerState
protected ECKey getClientKey()
getClientKey
in class PaymentChannelServerState
public ListenableFuture<Transaction> close() throws InsufficientMoneyException
PaymentChannelServerState
Closes this channel and broadcasts the highest value payment transaction on the network.
close
in class PaymentChannelServerState
InsufficientMoneyException
- If the payment tx would have cost more in fees to spend than it is worth.Copyright © 2016. All rights reserved.