mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
display full derivation path where possible
This commit is contained in:
parent
f723d20c9a
commit
ab5fdef919
1 changed files with 18 additions and 1 deletions
|
@ -101,7 +101,7 @@ public class ReceiveController extends WalletFormController implements Initializ
|
|||
this.currentEntry = nodeEntry;
|
||||
address.setText(nodeEntry.getAddress().toString());
|
||||
label.textProperty().bindBidirectional(nodeEntry.labelProperty());
|
||||
derivationPath.setText(nodeEntry.getNode().getDerivationPath());
|
||||
updateDerivationPath(nodeEntry);
|
||||
|
||||
updateLastUsed();
|
||||
|
||||
|
@ -119,6 +119,23 @@ public class ReceiveController extends WalletFormController implements Initializ
|
|||
updateDisplayAddress(AppController.getDevices());
|
||||
}
|
||||
|
||||
private void updateDerivationPath(NodeEntry nodeEntry) {
|
||||
KeyDerivation firstDerivation = getWalletForm().getWallet().getKeystores().get(0).getKeyDerivation();
|
||||
boolean singleDerivationPath = true;
|
||||
for(Keystore keystore : getWalletForm().getWallet().getKeystores()) {
|
||||
if(!keystore.getKeyDerivation().getDerivationPath().equals(firstDerivation.getDerivationPath())) {
|
||||
singleDerivationPath = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(singleDerivationPath) {
|
||||
derivationPath.setText(firstDerivation.extend(nodeEntry.getNode().getDerivation()).getDerivationPath());
|
||||
} else {
|
||||
derivationPath.setText(nodeEntry.getNode().getDerivationPath().replace("m", "multi"));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateLastUsed() {
|
||||
Set<BlockTransactionHashIndex> currentOutputs = currentEntry.getNode().getTransactionOutputs();
|
||||
if(AppController.isOnline() && currentOutputs.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue