Don't check sig if no sig is there.

This commit is contained in:
Manfred Karrer 2017-06-12 17:49:21 +02:00
parent 9b5172b2de
commit 75ed3f3baf

View File

@ -34,6 +34,7 @@ import org.bitcoinj.crypto.KeyCrypter;
import org.bitcoinj.crypto.KeyCrypterScrypt;
import org.bitcoinj.crypto.TransactionSignature;
import org.bitcoinj.script.Script;
import org.bitcoinj.script.ScriptChunk;
import org.bitcoinj.signers.TransactionSigner;
import org.bitcoinj.utils.Threading;
import org.bitcoinj.wallet.*;
@ -236,6 +237,9 @@ public abstract class WalletService {
Transaction partialTx = propTx.partialTx;
txIn = partialTx.getInput(index);
if (txIn.getConnectedOutput() != null) {
// If we dont have a sig we don't do the check to avoid error reports of failed sig checks
final List<ScriptChunk> chunks = txIn.getConnectedOutput().getScriptPubKey().getChunks();
if (!chunks.isEmpty() && chunks.get(0).data != null && chunks.get(0).data.length > 0) {
try {
// We assume if its already signed, its hopefully got a SIGHASH type that will not invalidate when
// we sign missing pieces (to check this would require either assuming any signatures are signing
@ -246,6 +250,7 @@ public abstract class WalletService {
} catch (ScriptException e) {
// Expected.
}
}
redeemData = txIn.getConnectedRedeemData(maybeDecryptingKeyBag);
scriptPubKey = txIn.getConnectedOutput().getScriptPubKey();