mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
add comments
This commit is contained in:
parent
829be40243
commit
ef2e2a1855
4 changed files with 9 additions and 1 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
||||||
Subproject commit 66d4e11bf6f05da79d67c955b9b1cb37095360f4
|
Subproject commit 2e1012da8b1135ba1569a6bc4c8b2fc856af17c8
|
|
@ -529,6 +529,8 @@ public class AppController implements Initializable {
|
||||||
FXMLLoader walletLoader = new FXMLLoader(getClass().getResource("wallet/wallet.fxml"));
|
FXMLLoader walletLoader = new FXMLLoader(getClass().getResource("wallet/wallet.fxml"));
|
||||||
tab.setContent(walletLoader.load());
|
tab.setContent(walletLoader.load());
|
||||||
WalletController controller = walletLoader.getController();
|
WalletController controller = walletLoader.getController();
|
||||||
|
|
||||||
|
//Note that only one WalletForm is created per wallet tab, and registered to listen for events. All wallet controllers (except SettingsController) share this instance.
|
||||||
WalletForm walletForm = new WalletForm(storage, wallet);
|
WalletForm walletForm = new WalletForm(storage, wallet);
|
||||||
EventManager.get().register(walletForm);
|
EventManager.get().register(walletForm);
|
||||||
controller.setWalletForm(walletForm);
|
controller.setWalletForm(walletForm);
|
||||||
|
|
|
@ -141,7 +141,9 @@ public class ElectrumServer {
|
||||||
WalletNode purposeNode = wallet.getNode(keyPurpose);
|
WalletNode purposeNode = wallet.getNode(keyPurpose);
|
||||||
getHistory(wallet, purposeNode.getChildren(), nodeTransactionMap, 0);
|
getHistory(wallet, purposeNode.getChildren(), nodeTransactionMap, 0);
|
||||||
|
|
||||||
|
//Because node children are added sequentially in WalletNode.fillToIndex, we can simply look at the number of children to determine the highest filled index
|
||||||
int historySize = purposeNode.getChildren().size();
|
int historySize = purposeNode.getChildren().size();
|
||||||
|
//The gap limit size takes the highest used index in the retrieved history and adds the gap limit (plus one to be comparable to the number of children since index is zero based)
|
||||||
int gapLimitSize = getGapLimitSize(nodeTransactionMap);
|
int gapLimitSize = getGapLimitSize(nodeTransactionMap);
|
||||||
while(historySize < gapLimitSize) {
|
while(historySize < gapLimitSize) {
|
||||||
purposeNode.fillToIndex(gapLimitSize - 1);
|
purposeNode.fillToIndex(gapLimitSize - 1);
|
||||||
|
|
|
@ -7,6 +7,10 @@ import com.sparrowwallet.sparrow.io.Storage;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class extends WalletForm to allow rollback of wallet changes. It is used exclusively by SettingsController for this purpose.
|
||||||
|
* Note it should not be registered to listen for events - this will cause double wallet updates.
|
||||||
|
*/
|
||||||
public class SettingsWalletForm extends WalletForm {
|
public class SettingsWalletForm extends WalletForm {
|
||||||
private Wallet walletCopy;
|
private Wallet walletCopy;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue