mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
show error dialog on cpfp if no outputs are spendable
This commit is contained in:
parent
c81c42a87c
commit
a5312374a8
1 changed files with 4 additions and 2 deletions
|
@ -352,12 +352,14 @@ public class EntryCell extends TreeTableCell<Entry, Entry> implements Confirmati
|
||||||
List<BlockTransactionHashIndex> ourOutputs = transactionEntry.getChildren().stream()
|
List<BlockTransactionHashIndex> ourOutputs = transactionEntry.getChildren().stream()
|
||||||
.filter(e -> e instanceof HashIndexEntry)
|
.filter(e -> e instanceof HashIndexEntry)
|
||||||
.map(e -> (HashIndexEntry)e)
|
.map(e -> (HashIndexEntry)e)
|
||||||
.filter(e -> e.getType().equals(HashIndexEntry.Type.OUTPUT))
|
.filter(e -> e.getType().equals(HashIndexEntry.Type.OUTPUT) && e.isSpendable())
|
||||||
.map(HashIndexEntry::getHashIndex)
|
.map(HashIndexEntry::getHashIndex)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
if(ourOutputs.isEmpty()) {
|
if(ourOutputs.isEmpty()) {
|
||||||
throw new IllegalStateException("Cannot create CPFP without any wallet outputs to spend");
|
AppServices.showErrorDialog("No spendable outputs", "None of the outputs on this transaction are spendable.\n\n Ensure that the outputs are not frozen" +
|
||||||
|
(transactionEntry.getConfirmations() <= 0 ? ", and spending unconfirmed UTXOs is allowed." : "."));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockTransactionHashIndex cpfpUtxo = ourOutputs.get(0);
|
BlockTransactionHashIndex cpfpUtxo = ourOutputs.get(0);
|
||||||
|
|
Loading…
Reference in a new issue