Skip to content

Commit

Permalink
refactor electrumserver into net package
Browse files Browse the repository at this point in the history
  • Loading branch information
craigraw committed Aug 10, 2020
1 parent 7d8774c commit bb635a6
Show file tree
Hide file tree
Showing 19 changed files with 479 additions and 403 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/sparrowwallet/sparrow/AppController.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.sparrowwallet.sparrow.control.*;
import com.sparrowwallet.sparrow.event.*;
import com.sparrowwallet.sparrow.io.*;
import com.sparrowwallet.sparrow.net.ElectrumServer;
import com.sparrowwallet.sparrow.preferences.PreferencesDialog;
import com.sparrowwallet.sparrow.transaction.TransactionController;
import com.sparrowwallet.sparrow.transaction.TransactionView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,17 @@ protected Node getContentBox(String message) {
}

private void removeArrow() {
removeArrow(0);
}

private void removeArrow(int count) {
Platform.runLater(() -> {
Node arrow = this.lookup(".arrow");
if (arrow != null) {
arrow.setVisible(false);
arrow.setManaged(false);
} else {
removeArrow();
} else if(count < 20) {
removeArrow(count+1);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.sparrowwallet.drongo.KeyPurpose;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.drongo.wallet.WalletNode;
import com.sparrowwallet.sparrow.io.ElectrumServer;
import com.sparrowwallet.sparrow.net.ElectrumServer;

import java.util.List;

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/sparrowwallet/sparrow/net/BlockHeaderTip.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.sparrowwallet.sparrow.net;

import com.sparrowwallet.drongo.Utils;
import com.sparrowwallet.drongo.protocol.BlockHeader;

class BlockHeaderTip {
public int height;
public String hex;

public BlockHeader getBlockHeader() {
if(hex == null) {
return null;
}

byte[] blockHeaderBytes = Utils.hexToBytes(hex);
return new BlockHeader(blockHeaderBytes);
}
}
Loading

0 comments on commit bb635a6

Please sign in to comment.