mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-10 08:37:05 +00:00
add comments
This commit is contained in:
@@ -529,6 +529,8 @@ public class AppController implements Initializable {
|
||||
FXMLLoader walletLoader = new FXMLLoader(getClass().getResource("wallet/wallet.fxml"));
|
||||
tab.setContent(walletLoader.load());
|
||||
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);
|
||||
EventManager.get().register(walletForm);
|
||||
controller.setWalletForm(walletForm);
|
||||
|
||||
@@ -141,7 +141,9 @@ public class ElectrumServer {
|
||||
WalletNode purposeNode = wallet.getNode(keyPurpose);
|
||||
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();
|
||||
//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);
|
||||
while(historySize < gapLimitSize) {
|
||||
purposeNode.fillToIndex(gapLimitSize - 1);
|
||||
|
||||
@@ -7,6 +7,10 @@ import com.sparrowwallet.sparrow.io.Storage;
|
||||
|
||||
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 {
|
||||
private Wallet walletCopy;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user