3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-15 19:55:51 +00:00

Wallet: Fix crash when isAddressMine() is called with a P2SH or a P2WSH address.

This commit is contained in:
Andreas Schildbach 2019-03-07 15:45:13 +01:00
parent 937d93e024
commit 1d8c78f327

View File

@ -1173,6 +1173,10 @@ public class Wallet extends BaseTaggableObject
final ScriptType scriptType = address.getOutputScriptType();
if (scriptType == ScriptType.P2PKH || scriptType == ScriptType.P2WPKH)
return isPubKeyHashMine(address.getHash(), scriptType);
else if (scriptType == ScriptType.P2SH)
return isPayToScriptHashMine(address.getHash());
else if (scriptType == ScriptType.P2WSH)
return false;
else
throw new IllegalArgumentException(address.toString());
}