mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 12:01:24 +00:00
Wallet: Fix crash when isAddressMine() is called with a P2SH or a P2WSH address.
This commit is contained in:
@@ -1173,6 +1173,10 @@ public class Wallet extends BaseTaggableObject
|
|||||||
final ScriptType scriptType = address.getOutputScriptType();
|
final ScriptType scriptType = address.getOutputScriptType();
|
||||||
if (scriptType == ScriptType.P2PKH || scriptType == ScriptType.P2WPKH)
|
if (scriptType == ScriptType.P2PKH || scriptType == ScriptType.P2WPKH)
|
||||||
return isPubKeyHashMine(address.getHash(), scriptType);
|
return isPubKeyHashMine(address.getHash(), scriptType);
|
||||||
|
else if (scriptType == ScriptType.P2SH)
|
||||||
|
return isPayToScriptHashMine(address.getHash());
|
||||||
|
else if (scriptType == ScriptType.P2WSH)
|
||||||
|
return false;
|
||||||
else
|
else
|
||||||
throw new IllegalArgumentException(address.toString());
|
throw new IllegalArgumentException(address.toString());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user