Add isMine method. Add error logs

This commit is contained in:
chimp1984 2021-10-20 15:53:01 +02:00
parent 34c4eefb59
commit 47572888e7
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -357,12 +357,13 @@ public abstract class WalletService {
txIn.setScriptSig(ScriptBuilder.createEmpty());
txIn.setWitness(TransactionWitness.redeemP2WPKH(txSig, key));
} catch (ECKey.KeyIsEncryptedException e1) {
log.error(e1.toString());
throw e1;
} catch (ECKey.MissingPrivateKeyException e1) {
log.warn("No private key in keypair for input {}", index);
}
} else {
// log.error("Unexpected script type.");
log.error("Unexpected script type.");
throw new RuntimeException("Unexpected script type.");
}
} else {
@ -546,6 +547,10 @@ public abstract class WalletService {
return getNumTxOutputsForAddress(address) == 0;
}
public boolean isMine(TransactionOutput transactionOutput) {
return transactionOutput.isMine(wallet);
}
// BISQ issue #4039: Prevent dust outputs from being created.
// Check the outputs of a proposed transaction. If any are below the dust threshold,
// add up the dust, log the details, and return the cumulative dust amount.