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 |
---|---|
com.google.common.util.concurrent.ListenableFuture<Transaction> |
close(org.bouncycastle.crypto.params.KeyParameter userKey)
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.
|
com.google.common.collect.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
|
close, 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 com.google.common.collect.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 com.google.common.util.concurrent.ListenableFuture<Transaction> close(@Nullable org.bouncycastle.crypto.params.KeyParameter userKey) throws InsufficientMoneyException
PaymentChannelServerState
Closes this channel and broadcasts the highest value payment transaction on the network.
close
in class PaymentChannelServerState
userKey
- The AES key to use for decryption of the private key. If null then no decryption is required.InsufficientMoneyException
- If the payment tx would have cost more in fees to spend than it is worth.