mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
better handling of showing blocktransaction details
This commit is contained in:
parent
f35b3d46a1
commit
7d8774c94c
2 changed files with 13 additions and 4 deletions
|
@ -111,6 +111,7 @@ public class ElectrumServer {
|
||||||
|
|
||||||
public List<String> getServerVersion() throws ServerException {
|
public List<String> getServerVersion() throws ServerException {
|
||||||
JsonRpcClient client = new JsonRpcClient(getTransport());
|
JsonRpcClient client = new JsonRpcClient(getTransport());
|
||||||
|
//return client.createRequest().returnAsList(String.class).method("server.version").id(1).params("Sparrow", "1.4").execute();
|
||||||
return client.createRequest().returnAsList(String.class).method("server.version").id(1).param("client_name", "Sparrow").param("protocol_version", SUPPORTED_VERSIONS).execute();
|
return client.createRequest().returnAsList(String.class).method("server.version").id(1).param("client_name", "Sparrow").param("protocol_version", SUPPORTED_VERSIONS).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -464,20 +464,28 @@ public class HeadersController extends TransactionFormController implements Init
|
||||||
blockHeightField.managedProperty().bind(blockHeightField.visibleProperty());
|
blockHeightField.managedProperty().bind(blockHeightField.visibleProperty());
|
||||||
blockTimestampField.managedProperty().bind(blockTimestampField.visibleProperty());
|
blockTimestampField.managedProperty().bind(blockTimestampField.visibleProperty());
|
||||||
blockHashField.managedProperty().bind(blockHashField.visibleProperty());
|
blockHashField.managedProperty().bind(blockHashField.visibleProperty());
|
||||||
blockTimestampField.visibleProperty().bind(blockHeightField.visibleProperty());
|
|
||||||
blockHashField.visibleProperty().bind(blockHeightField.visibleProperty());
|
|
||||||
|
|
||||||
if(blockTransaction.getBlockHash() != null) {
|
if(blockTransaction.getHeight() > 0) {
|
||||||
blockHeightField.setVisible(true);
|
blockHeightField.setVisible(true);
|
||||||
blockHeight.setText(Integer.toString(blockTransaction.getHeight()));
|
blockHeight.setText(Integer.toString(blockTransaction.getHeight()));
|
||||||
|
} else {
|
||||||
|
blockHeightField.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(blockTransaction.getDate() != null) {
|
||||||
|
blockTimestampField.setVisible(true);
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat(BLOCK_TIMESTAMP_DATE_FORMAT);
|
SimpleDateFormat dateFormat = new SimpleDateFormat(BLOCK_TIMESTAMP_DATE_FORMAT);
|
||||||
blockTimestamp.setText(dateFormat.format(blockTransaction.getDate()));
|
blockTimestamp.setText(dateFormat.format(blockTransaction.getDate()));
|
||||||
|
} else {
|
||||||
|
blockTimestampField.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(blockTransaction.getBlockHash() != null) {
|
||||||
|
blockHashField.setVisible(true);
|
||||||
blockHash.setText(blockTransaction.getBlockHash().toString());
|
blockHash.setText(blockTransaction.getBlockHash().toString());
|
||||||
blockHash.setContextMenu(new BlockHeightContextMenu(blockTransaction.getBlockHash()));
|
blockHash.setContextMenu(new BlockHeightContextMenu(blockTransaction.getBlockHash()));
|
||||||
} else {
|
} else {
|
||||||
blockHeightField.setVisible(false);
|
blockHashField.setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue