Skip to content

Commit a7e3c6d

Browse files
authored
Merge pull request #877 from lxcmyf/feature/dev_491
feat(readme): improve the readme information
2 parents d809153 + 6a70c2a commit a7e3c6d

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,7 +2116,7 @@ Modify Wallet Name successful !!
21162116
### View backup records
21172117
> ViewBackupRecords
21182118
2119-
View backup records.
2119+
View backup records. You can configure the maximum number of records that `maxRecords` can retain in `config.conf`, excluding the number of buffer records.
21202120

21212121
Example:
21222122
```console
@@ -2130,13 +2130,13 @@ Choose an option (1-2): 1
21302130
### View transaction history
21312131
> ViewTransactionHistory
21322132
2133-
View transaction history.
2133+
View transaction history. You can configure the maximum number of records that `maxRecords` can retain in `config.conf`, excluding the number of buffer records.
21342134

21352135
Example:
21362136
```console
21372137
wallet> ViewTransactionHistory
21382138
====================================
2139-
COMPLETE TRANSACTION VIEWER
2139+
TRANSACTION VIEWER
21402140
====================================
21412141

21422142
MAIN MENU:

src/main/java/org/tron/common/utils/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,8 +1375,8 @@ public static void listWallets(List<WalletFile> walletFileList) {
13751375
WalletFile wf = walletFileList.get(i);
13761376
return formatLine(
13771377
String.valueOf(i + 1),
1378-
wf.getName(),
13791378
wf.getAddress(),
1379+
wf.getName(),
13801380
4, 42, 76);
13811381
})
13821382
.forEach(System.out::println);

src/main/java/org/tron/keystore/WalletUtils.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ public static void updateWalletFile(
108108

109109
public static String generateWalletFile(WalletFile walletFile, File destinationDirectory)
110110
throws IOException {
111-
String fileName = getWalletFileName(walletFile);
111+
String name = walletFile.getName();
112+
String fileName;
113+
if (StringUtils.isNotEmpty(name) && name.startsWith("Ledger-")) {
114+
fileName = getLegerWalletFileName(walletFile);
115+
} else {
116+
fileName = getWalletFileName(walletFile);
117+
}
118+
112119
File destination = new File(destinationDirectory, fileName);
113120
objectMapper.writeValue(destination, walletFile);
114121
if (StringUtils.isEmpty(walletFile.getName())) {

src/main/java/org/tron/walletserver/WalletApi.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,12 @@ public void cleanup() {
27952795
}
27962796

27972797
public boolean modifyWalletName(String newName) throws IOException {
2798-
WalletFile wf = this.walletFile.get(0);
2798+
WalletFile wf = getWalletFile();
2799+
String originalName = wf.getName();
2800+
if (originalName != null && originalName.startsWith("Ledger-") &&
2801+
!newName.startsWith("Ledger-")) {
2802+
newName = "Ledger-" + newName;
2803+
}
27992804
wf.setName(newName);
28002805
String keystoreName = WalletApi.store2Keystore(wf);
28012806
return StringUtils.isNotEmpty(keystoreName);

src/main/resources/commands.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,12 @@ wallet> ModifyWalletName myNewWallet
763763
Syntax:
764764
ViewBackupRecords
765765
Summary:
766-
View backup records.
766+
View backup records. You can configure the maximum number of records that `maxRecords` can retain in `config.conf`, excluding the number of buffer records.
767767
Usage example:
768768
wallet> ViewBackupRecords
769769
Syntax:
770770
ViewTransactionHistory
771771
Summary:
772-
View transaction history.
772+
View transaction history. You can configure the maximum number of records that `maxRecords` can retain in `config.conf`, excluding the number of buffer records.
773773
Usage example:
774774
wallet> ViewTransactionHistory

0 commit comments

Comments
 (0)