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

View file

@ -117,6 +117,10 @@ processResources {
} }
} }
test {
jvmArgs '--add-opens=java.base/java.io=ALL-UNNAMED'
}
run { run {
applicationDefaultJvmArgs = ["--add-opens=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls", applicationDefaultJvmArgs = ["--add-opens=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls",
"--add-opens=javafx.graphics/javafx.scene=org.controlsfx.controls", "--add-opens=javafx.graphics/javafx.scene=org.controlsfx.controls",
@ -198,7 +202,7 @@ jlink {
imageName = "Sparrow" imageName = "Sparrow"
installerName = "Sparrow" installerName = "Sparrow"
appVersion = "${sparrowVersion}" appVersion = "${sparrowVersion}"
skipInstaller = os.macOsX skipInstaller = os.macOsX || properties.skipInstallers
imageOptions = [] imageOptions = []
installerOptions = ['--file-associations', 'src/main/deploy/psbt.properties', '--file-associations', 'src/main/deploy/txn.properties', '--file-associations', 'src/main/deploy/bitcoin.properties', '--file-associations', 'src/main/deploy/aopp.properties', '--license-file', 'LICENSE'] installerOptions = ['--file-associations', 'src/main/deploy/psbt.properties', '--file-associations', 'src/main/deploy/txn.properties', '--file-associations', 'src/main/deploy/bitcoin.properties', '--file-associations', 'src/main/deploy/aopp.properties', '--license-file', 'LICENSE']
if(os.windows) { if(os.windows) {

2
drongo

@ -1 +1 @@
Subproject commit 0b40c20ab252e29ac192bca34d834b8c3eed04a0 Subproject commit 38783d68a49ecf5d8c8640edb299d693f455b2a9

View file

@ -793,6 +793,7 @@ public class AppServices {
@Subscribe @Subscribe
public void newConnection(ConnectionEvent event) { public void newConnection(ConnectionEvent event) {
currentBlockHeight = event.getBlockHeight(); currentBlockHeight = event.getBlockHeight();
System.setProperty(Network.BLOCK_HEIGHT_PROPERTY, Integer.toString(currentBlockHeight));
targetBlockFeeRates = event.getTargetBlockFeeRates(); targetBlockFeeRates = event.getTargetBlockFeeRates();
addMempoolRateSizes(event.getMempoolRateSizes()); addMempoolRateSizes(event.getMempoolRateSizes());
minimumRelayFeeRate = event.getMinimumRelayFeeRate(); minimumRelayFeeRate = event.getMinimumRelayFeeRate();
@ -807,6 +808,7 @@ public class AppServices {
@Subscribe @Subscribe
public void newBlock(NewBlockEvent event) { public void newBlock(NewBlockEvent event) {
currentBlockHeight = event.getHeight(); currentBlockHeight = event.getHeight();
System.setProperty(Network.BLOCK_HEIGHT_PROPERTY, Integer.toString(currentBlockHeight));
latestBlockHeader = event.getBlockHeader(); latestBlockHeader = event.getBlockHeader();
String status = "Updating to new block height " + event.getHeight(); String status = "Updating to new block height " + event.getHeight();
EventManager.get().post(new StatusEvent(status)); EventManager.get().post(new StatusEvent(status));

View file

@ -34,7 +34,7 @@ public class AddressTreeTable extends CoinTreeTable {
addressCol.setSortable(false); addressCol.setSortable(false);
getColumns().add(addressCol); getColumns().add(addressCol);
if(address != null && !rootEntry.getWallet().isWhirlpoolMixWallet()) { if(address != null && !rootEntry.getWallet().isWhirlpoolChildWallet()) {
addressCol.setMinWidth(TextUtils.computeTextWidth(AppServices.getMonospaceFont(), address, 0.0)); addressCol.setMinWidth(TextUtils.computeTextWidth(AppServices.getMonospaceFont(), address, 0.0));
} }

View file

@ -131,7 +131,7 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
setGraphic(actionBox); setGraphic(actionBox);
if(nodeEntry.getWallet().isWhirlpoolMixWallet()) { if(nodeEntry.getWallet().isWhirlpoolChildWallet()) {
setText(address.toString().substring(0, 20) + "..."); setText(address.toString().substring(0, 20) + "...");
setContextMenu(null); setContextMenu(null);
setGraphic(new HBox()); setGraphic(new HBox());

View file

@ -115,7 +115,7 @@ public class AddressesController extends WalletFormController implements Initial
fileChooser.setTitle("Export Addresses to CSV"); fileChooser.setTitle("Export Addresses to CSV");
fileChooser.setInitialFileName(getWalletForm().getWallet().getFullName() + "-" + keyPurpose.name().toLowerCase() + "-addresses.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(); Wallet copy = getWalletForm().getWallet().copy();
WalletNode purposeNode = copy.getNode(keyPurpose); WalletNode purposeNode = copy.getNode(keyPurpose);
purposeNode.fillToIndex(Math.max(purposeNode.getChildren().size(), DEFAULT_EXPORT_ADDRESSES_LENGTH)); 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"}); writer.writeRecord(new String[] {"Index", "Payment Address", "Derivation", "Label"});
for(WalletNode indexNode : purposeNode.getChildren()) { for(WalletNode indexNode : purposeNode.getChildren()) {
writer.write(Integer.toString(indexNode.getIndex())); 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)); writer.write(getDerivationPath(indexNode));
Optional<Entry> optLabelEntry = getWalletForm().getNodeEntry(keyPurpose).getChildren().stream() Optional<Entry> optLabelEntry = getWalletForm().getNodeEntry(keyPurpose).getChildren().stream()
.filter(entry -> ((NodeEntry)entry).getNode().getIndex() == indexNode.getIndex()).findFirst(); .filter(entry -> ((NodeEntry)entry).getNode().getIndex() == indexNode.getIndex()).findFirst();

View file

@ -78,7 +78,7 @@ public class WalletController extends WalletFormController implements Initializa
public void configure(Wallet wallet) { public void configure(Wallet wallet) {
boolean validWallet = wallet.isValid(); boolean validWallet = wallet.isValid();
boolean whirlpoolMixWallet = wallet.isWhirlpoolMixWallet(); boolean whirlpoolChildWallet = wallet.isWhirlpoolChildWallet();
for(Toggle toggle : walletMenu.getToggles()) { for(Toggle toggle : walletMenu.getToggles()) {
if(toggle.getUserData().equals(Function.SETTINGS)) { if(toggle.getUserData().equals(Function.SETTINGS)) {
@ -90,7 +90,7 @@ public class WalletController extends WalletFormController implements Initializa
toggle.setSelected(true); toggle.setSelected(true);
} }
((ToggleButton)toggle).setDisable(!validWallet || (whirlpoolMixWallet && toggle.getUserData().equals(Function.RECEIVE))); ((ToggleButton)toggle).setDisable(!validWallet || (whirlpoolChildWallet && toggle.getUserData().equals(Function.RECEIVE)));
} }
} }
} }