fix copy address output script bytes to return entire scriptpubkey
@@ -654,23 +654,27 @@ public class EntryCell extends TreeTableCell<Entry, Entry> implements Confirmati
Clipboard.getSystemClipboard().setContent(content);
});
- MenuItem copyHex = new MenuItem("Copy Script Output Bytes");
- copyHex.setOnAction(AE -> {
+ MenuItem copyOutputDescriptor = new MenuItem("Copy Output Descriptor");
+ copyOutputDescriptor.setOnAction(AE -> {
hide();
ClipboardContent content = new ClipboardContent();
- content.putString(Utils.bytesToHex(address.getOutputScriptData()));
+ content.putString(outputDescriptor);
Clipboard.getSystemClipboard().setContent(content);
});
- MenuItem copyOutputDescriptor = new MenuItem("Copy Output Descriptor");
- copyOutputDescriptor.setOnAction(AE -> {
+ getItems().addAll(copyAddress, copyOutputDescriptor);
+
+ if(nodeEntry != null) {
+ MenuItem copyHex = new MenuItem("Copy Script Output Bytes");
+ copyHex.setOnAction(AE -> {
hide();
+ Script outputScript = nodeEntry.getWallet().getOutputScript(nodeEntry.getNode());
ClipboardContent content = new ClipboardContent();
- content.putString(outputDescriptor);
+ content.putString(Utils.bytesToHex(outputScript.getProgram()));
Clipboard.getSystemClipboard().setContent(content);
});
-
- getItems().addAll(copyAddress, copyHex, copyOutputDescriptor);
+ getItems().add(copyHex);
+ }
}
}
