Browse Source

add context menu item to addresses table to spend all utxos for an address

terminal
Craig Raw 2 years ago
parent
commit
51ba7fc4cf
  1. 10
      src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java

10
src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java

@ -559,6 +559,16 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
}
if(nodeEntry != null && !nodeEntry.getNode().getUnspentTransactionOutputs().isEmpty()) {
List<BlockTransactionHashIndex> utxos = nodeEntry.getNode().getUnspentTransactionOutputs().stream().collect(Collectors.toList());
MenuItem spendUtxos = new MenuItem("Spend UTXOs");
spendUtxos.setGraphic(getSendGlyph());
spendUtxos.setOnAction(AE -> {
hide();
EventManager.get().post(new SendActionEvent(nodeEntry.getWallet(), utxos));
Platform.runLater(() -> EventManager.get().post(new SpendUtxoEvent(nodeEntry.getWallet(), utxos)));
});
getItems().add(spendUtxos);
List<BlockTransactionHashIndex> unfrozenUtxos = nodeEntry.getNode().getUnspentTransactionOutputs().stream().filter(utxo -> utxo.getStatus() != Status.FROZEN).collect(Collectors.toList());
if(!unfrozenUtxos.isEmpty()) {
MenuItem freezeUtxos = new MenuItem("Freeze UTXOs");

Loading…
Cancel
Save