mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-11-02 18:26:43 +00:00
activate p2tr script type on testnet, and on mainnet after activation
This commit is contained in:
parent
db081695e8
commit
46e4413cf6
1 changed files with 6 additions and 1 deletions
|
@ -8,6 +8,8 @@ import com.sparrowwallet.drongo.crypto.ChildNumber;
|
||||||
import com.sparrowwallet.drongo.crypto.ECKey;
|
import com.sparrowwallet.drongo.crypto.ECKey;
|
||||||
import com.sparrowwallet.drongo.policy.PolicyType;
|
import com.sparrowwallet.drongo.policy.PolicyType;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.Month;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -1132,10 +1134,13 @@ public enum ScriptType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PolicyType> getAllowedPolicyTypes() {
|
public List<PolicyType> getAllowedPolicyTypes() {
|
||||||
return Network.get() == Network.REGTEST || Network.get() == Network.SIGNET ? List.of(SINGLE) : Collections.emptyList();
|
return (Network.get() == Network.MAINNET && LocalDate.now().isAfter(TAPROOT_MAINNET_ACTIVATION_DATE)) || Network.get() == Network.TESTNET || Network.get() == Network.REGTEST || Network.get() == Network.SIGNET ? List.of(SINGLE) : Collections.emptyList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//To avoid relying on a network-dependent block height >= 709632 check, use a approximate activation date. This can be removed once Taproot has activated on mainnet.
|
||||||
|
private static final LocalDate TAPROOT_MAINNET_ACTIVATION_DATE = LocalDate.of(2021, Month.NOVEMBER, 22);
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final String description;
|
private final String description;
|
||||||
private final String defaultDerivationPath;
|
private final String defaultDerivationPath;
|
||||||
|
|
Loading…
Reference in a new issue