Browse Source

add comments

bwt
Craig Raw 5 years ago
parent
commit
ef2e2a1855
  1. 2
      drongo
  2. 2
      src/main/java/com/sparrowwallet/sparrow/AppController.java
  3. 2
      src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java
  4. 4
      src/main/java/com/sparrowwallet/sparrow/wallet/SettingsWalletForm.java

2
drongo

@ -1 +1 @@
Subproject commit 66d4e11bf6f05da79d67c955b9b1cb37095360f4
Subproject commit 2e1012da8b1135ba1569a6bc4c8b2fc856af17c8

2
src/main/java/com/sparrowwallet/sparrow/AppController.java

@ -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);

2
src/main/java/com/sparrowwallet/sparrow/io/ElectrumServer.java

@ -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);

4
src/main/java/com/sparrowwallet/sparrow/wallet/SettingsWalletForm.java

@ -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;

Loading…
Cancel
Save