Wallet: Fix crash when isAddressMine() is called with a P2SH or a P2WSH address.
@@ -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());
}
