Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix peer handling #2854

Merged
merged 2 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/main/java/bisq/core/btc/wallet/WalletService.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public abstract class WalletService {
protected final CopyOnWriteArraySet<TxConfidenceListener> txConfidenceListeners = new CopyOnWriteArraySet<>();
protected final CopyOnWriteArraySet<BalanceListener> balanceListeners = new CopyOnWriteArraySet<>();
protected Wallet wallet;
@Getter
protected KeyParameter aesKey;
@Getter
protected IntegerProperty chainHeightProperty = new SimpleIntegerProperty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ public MeritList getMerits(@Nullable String blindVoteTxId) {
// The EC key is in the blockchain already. We prefer here to stick with EC key. If any change
// in BitcoinJ would break our consensus we would need to fall back to the old BitcoinJ EC
// implementation.
ECKey.ECDSASignature signature = key.sign(Sha256Hash.wrap(blindVoteTxId));
ECKey.ECDSASignature signature = bsqWalletService.isEncrypted() ?
key.sign(Sha256Hash.wrap(blindVoteTxId), bsqWalletService.getAesKey()) :
key.sign(Sha256Hash.wrap(blindVoteTxId));
signatureAsBytes = signature.toCanonicalised().encodeToDER();
} else {
// In case we use it for requesting the currently available merit we don't apply a signature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
@EqualsAndHashCode
public abstract class StateInConflictListItem<T extends StateHash> {
private final String peerAddress;
private final String peerAddressString;
private final String height;
private final String hash;
private final String prevHash;
Expand All @@ -43,7 +44,8 @@ public abstract class StateInConflictListItem<T extends StateHash> {
protected StateInConflictListItem(String peerAddress, T stateHash, int cycleIndex,
Set<NodeAddress> seedNodeAddresses) {
this.stateHash = stateHash;
this.peerAddress = seedNodeAddresses.stream().anyMatch(e -> e.getFullAddress().equals(peerAddress)) ?
this.peerAddress = peerAddress;
this.peerAddressString = seedNodeAddresses.stream().anyMatch(e -> e.getFullAddress().equals(peerAddress)) ?
Res.get("dao.monitor.table.seedPeers", peerAddress) :
peerAddress;
height = Res.get("dao.monitor.table.cycleBlockHeight",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public TableCell<CLI, CLI> call(
public void updateItem(final CLI item, boolean empty) {
super.updateItem(item, empty);
if (item != null)
setText(item.getPeerAddress());
setText(item.getPeerAddressString());
else
setText("");
}
Expand Down