Skip to content

Commit

Permalink
Merge pull request #2854 from sqrrm/fix-peer-handling
Browse files Browse the repository at this point in the history
Fix peer handling
  • Loading branch information
ripcurlx authored May 30, 2019
2 parents a147769 + 78a837e commit 126afd2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
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

0 comments on commit 126afd2

Please sign in to comment.