mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
signing multisig fixes
This commit is contained in:
parent
c9d7b03afc
commit
928731b383
8 changed files with 32 additions and 16 deletions
2
drongo
2
drongo
|
@ -1 +1 @@
|
|||
Subproject commit 4b4a980a9bead1589a1db4202ac5ed386832f4ab
|
||||
Subproject commit 4c5166a6ea886622d57254444e95efa043ba302f
|
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
BIN
src/main/.DS_Store
vendored
Normal file
BIN
src/main/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -34,10 +34,7 @@ public class BalanceChart extends LineChart<Number, Number> {
|
|||
}
|
||||
|
||||
public void update(WalletTransactionsEntry walletTransactionsEntry) {
|
||||
if(walletTransactionsEntry.getChildren().isEmpty()) {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
setVisible(!walletTransactionsEntry.getChildren().isEmpty());
|
||||
balanceSeries.getData().clear();
|
||||
|
||||
List<Data<Number, Number>> balanceDataList = walletTransactionsEntry.getChildren().stream()
|
||||
|
|
|
@ -197,14 +197,7 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
});
|
||||
version.setDisable(!headersForm.isEditable());
|
||||
|
||||
String type = "Legacy";
|
||||
if(tx.isSegwit()) {
|
||||
type = "Segwit";
|
||||
if(tx.getSegwitVersion() == 2) {
|
||||
type = "Taproot";
|
||||
}
|
||||
}
|
||||
segwit.setText(type);
|
||||
updateType();
|
||||
|
||||
locktimeToggleGroup.selectedToggleProperty().addListener((ov, old_toggle, new_toggle) -> {
|
||||
if(locktimeToggleGroup.getSelectedToggle() != null) {
|
||||
|
@ -286,8 +279,7 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
locktimeBlock.setDisable(!headersForm.isEditable());
|
||||
locktimeDate.setDisable(!headersForm.isEditable());
|
||||
|
||||
size.setText(tx.getSize() + " B");
|
||||
virtualSize.setText(tx.getVirtualSize() + " vB");
|
||||
updateSize();
|
||||
|
||||
Long feeAmt = null;
|
||||
if(headersForm.getPsbt() != null) {
|
||||
|
@ -373,6 +365,22 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
}
|
||||
}
|
||||
|
||||
private void updateType() {
|
||||
String type = "Legacy";
|
||||
if(headersForm.getTransaction().isSegwit() || (headersForm.getPsbt() != null && headersForm.getPsbt().getPsbtInputs().stream().anyMatch(in -> in.getWitnessUtxo() != null))) {
|
||||
type = "Segwit";
|
||||
if(headersForm.getTransaction().getSegwitVersion() == 2) {
|
||||
type = "Taproot";
|
||||
}
|
||||
}
|
||||
segwit.setText(type);
|
||||
}
|
||||
|
||||
private void updateSize() {
|
||||
size.setText(headersForm.getTransaction().getSize() + " B");
|
||||
virtualSize.setText(headersForm.getTransaction().getVirtualSize() + " vB");
|
||||
}
|
||||
|
||||
private Long calculateFee(Map<Sha256Hash, BlockTransaction> inputTransactions) {
|
||||
long feeAmt = 0L;
|
||||
for(TransactionInput input : headersForm.getTransaction().getInputs()) {
|
||||
|
@ -551,6 +559,10 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
return;
|
||||
}
|
||||
|
||||
if(headersForm.getPsbt().isSigned()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Wallet copy = headersForm.getSigningWallet().copy();
|
||||
File file = headersForm.getAvailableWallets().get(headersForm.getSigningWallet()).getWalletFile();
|
||||
|
||||
|
@ -590,6 +602,10 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
return;
|
||||
}
|
||||
|
||||
if(headersForm.getPsbt().isSigned()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DeviceSignDialog dlg = new DeviceSignDialog(headersForm.getPsbt());
|
||||
Optional<PSBT> optionalSignedPsbt = dlg.showAndWait();
|
||||
if(optionalSignedPsbt.isPresent()) {
|
||||
|
@ -789,6 +805,9 @@ public class HeadersController extends TransactionFormController implements Init
|
|||
public void transactionExtracted(TransactionExtractedEvent event) {
|
||||
if(event.getPsbt().equals(headersForm.getPsbt())) {
|
||||
updateTxId();
|
||||
updateType();
|
||||
updateSize();
|
||||
updateFee(headersForm.getPsbt().getFee());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ public class WalletForm {
|
|||
|
||||
@Subscribe
|
||||
public void newBlock(NewBlockEvent event) {
|
||||
updateWallet(wallet, event.getHeight());
|
||||
updateWallet(wallet.copy(), event.getHeight());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
BIN
src/main/resources/.DS_Store
vendored
BIN
src/main/resources/.DS_Store
vendored
Binary file not shown.
BIN
src/test/resources/.DS_Store
vendored
BIN
src/test/resources/.DS_Store
vendored
Binary file not shown.
Loading…
Reference in a new issue