mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 23:32:16 +00:00
Payment channels: more informative exception message if you forget to add the client wallet extension.
This commit is contained in:
parent
85554f511f
commit
baeaa64201
@ -376,6 +376,7 @@ public class PaymentChannelClientState {
|
|||||||
@VisibleForTesting synchronized void doStoreChannelInWallet(Sha256Hash id) {
|
@VisibleForTesting synchronized void doStoreChannelInWallet(Sha256Hash id) {
|
||||||
StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates)
|
StoredPaymentChannelClientStates channels = (StoredPaymentChannelClientStates)
|
||||||
wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID);
|
wallet.getExtensions().get(StoredPaymentChannelClientStates.EXTENSION_ID);
|
||||||
|
checkNotNull(channels, "You have not added the StoredPaymentChannelClientStates extension to the wallet.");
|
||||||
checkState(channels.getChannel(id, multisigContract.getHash()) == null);
|
checkState(channels.getChannel(id, multisigContract.getHash()) == null);
|
||||||
storedChannel = new StoredClientChannel(id, multisigContract, refundTx, myKey, valueToMe, refundFees, true);
|
storedChannel = new StoredClientChannel(id, multisigContract, refundTx, myKey, valueToMe, refundFees, true);
|
||||||
channels.putChannel(storedChannel);
|
channels.putChannel(storedChannel);
|
||||||
|
Loading…
Reference in New Issue
Block a user