dont allow receiving on badbank wallet, introduce skipInstaller flag in build

This commit is contained in:
Craig Raw
2021-09-08 13:22:21 +02:00
parent 44b9cee825
commit aaca9ffa16
7 changed files with 14 additions and 8 deletions
@@ -793,6 +793,7 @@ public class AppServices {
@Subscribe
public void newConnection(ConnectionEvent event) {
currentBlockHeight = event.getBlockHeight();
System.setProperty(Network.BLOCK_HEIGHT_PROPERTY, Integer.toString(currentBlockHeight));
targetBlockFeeRates = event.getTargetBlockFeeRates();
addMempoolRateSizes(event.getMempoolRateSizes());
minimumRelayFeeRate = event.getMinimumRelayFeeRate();
@@ -807,6 +808,7 @@ public class AppServices {
@Subscribe
public void newBlock(NewBlockEvent event) {
currentBlockHeight = event.getHeight();
System.setProperty(Network.BLOCK_HEIGHT_PROPERTY, Integer.toString(currentBlockHeight));
latestBlockHeader = event.getBlockHeader();
String status = "Updating to new block height " + event.getHeight();
EventManager.get().post(new StatusEvent(status));
@@ -34,7 +34,7 @@ public class AddressTreeTable extends CoinTreeTable {
addressCol.setSortable(false);
getColumns().add(addressCol);
if(address != null && !rootEntry.getWallet().isWhirlpoolMixWallet()) {
if(address != null && !rootEntry.getWallet().isWhirlpoolChildWallet()) {
addressCol.setMinWidth(TextUtils.computeTextWidth(AppServices.getMonospaceFont(), address, 0.0));
}
@@ -131,7 +131,7 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
setGraphic(actionBox);
if(nodeEntry.getWallet().isWhirlpoolMixWallet()) {
if(nodeEntry.getWallet().isWhirlpoolChildWallet()) {
setText(address.toString().substring(0, 20) + "...");
setContextMenu(null);
setGraphic(new HBox());
@@ -115,7 +115,7 @@ public class AddressesController extends WalletFormController implements Initial
fileChooser.setTitle("Export Addresses to CSV");
fileChooser.setInitialFileName(getWalletForm().getWallet().getFullName() + "-" + keyPurpose.name().toLowerCase() + "-addresses.csv");
boolean whirlpoolMixWallet = getWalletForm().getWallet().isWhirlpoolMixWallet();
boolean whirlpoolChildWallet = getWalletForm().getWallet().isWhirlpoolChildWallet();
Wallet copy = getWalletForm().getWallet().copy();
WalletNode purposeNode = copy.getNode(keyPurpose);
purposeNode.fillToIndex(Math.max(purposeNode.getChildren().size(), DEFAULT_EXPORT_ADDRESSES_LENGTH));
@@ -128,7 +128,7 @@ public class AddressesController extends WalletFormController implements Initial
writer.writeRecord(new String[] {"Index", "Payment Address", "Derivation", "Label"});
for(WalletNode indexNode : purposeNode.getChildren()) {
writer.write(Integer.toString(indexNode.getIndex()));
writer.write(whirlpoolMixWallet ? copy.getAddress(indexNode).toString().substring(0, 20) + "..." : copy.getAddress(indexNode).toString());
writer.write(whirlpoolChildWallet ? copy.getAddress(indexNode).toString().substring(0, 20) + "..." : copy.getAddress(indexNode).toString());
writer.write(getDerivationPath(indexNode));
Optional<Entry> optLabelEntry = getWalletForm().getNodeEntry(keyPurpose).getChildren().stream()
.filter(entry -> ((NodeEntry)entry).getNode().getIndex() == indexNode.getIndex()).findFirst();
@@ -78,7 +78,7 @@ public class WalletController extends WalletFormController implements Initializa
public void configure(Wallet wallet) {
boolean validWallet = wallet.isValid();
boolean whirlpoolMixWallet = wallet.isWhirlpoolMixWallet();
boolean whirlpoolChildWallet = wallet.isWhirlpoolChildWallet();
for(Toggle toggle : walletMenu.getToggles()) {
if(toggle.getUserData().equals(Function.SETTINGS)) {
@@ -90,7 +90,7 @@ public class WalletController extends WalletFormController implements Initializa
toggle.setSelected(true);
}
((ToggleButton)toggle).setDisable(!validWallet || (whirlpoolMixWallet && toggle.getUserData().equals(Function.RECEIVE)));
((ToggleButton)toggle).setDisable(!validWallet || (whirlpoolChildWallet && toggle.getUserData().equals(Function.RECEIVE)));
}
}
}