mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 14:50:57 +01:00
SegwitAddress: Import Script rather than Script.ScriptType.
This commit is contained in:
parent
c87f4b3f77
commit
d4df1119de
1 changed files with 3 additions and 4 deletions
|
@ -25,7 +25,6 @@ import javax.annotation.Nullable;
|
|||
|
||||
import org.bitcoinj.params.Networks;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.Script.ScriptType;
|
||||
|
||||
/**
|
||||
* <p>Implementation of native segwit addresses. They are composed of two parts:</p>
|
||||
|
@ -135,14 +134,14 @@ public class SegwitAddress extends Address {
|
|||
* @return type of output script
|
||||
*/
|
||||
@Override
|
||||
public ScriptType getOutputScriptType() {
|
||||
public Script.ScriptType getOutputScriptType() {
|
||||
int version = getWitnessVersion();
|
||||
checkState(version == 0);
|
||||
int programLength = getWitnessProgram().length;
|
||||
if (programLength == WITNESS_PROGRAM_LENGTH_PKH)
|
||||
return ScriptType.P2WPKH;
|
||||
return Script.ScriptType.P2WPKH;
|
||||
if (programLength == WITNESS_PROGRAM_LENGTH_SH)
|
||||
return ScriptType.P2WSH;
|
||||
return Script.ScriptType.P2WSH;
|
||||
throw new IllegalStateException("Cannot happen.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue