File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ func backendSupportsTaproot(rpc *rpcclient.Client) bool {
4848 }
4949
5050 info := struct {
51+ ScriptFlags []string `json:"script_flags"`
5152 Deployments map [string ]struct {
5253 Type string `json:"type"`
5354 Active bool `json:"active"`
@@ -59,6 +60,21 @@ func backendSupportsTaproot(rpc *rpcclient.Client) bool {
5960 return false
6061 }
6162
63+ // Before Bitcoin Core v31, taproot was still included as a BIP9 deployment.
6264 _ , ok := info .Deployments ["taproot" ]
63- return ok
65+
66+ // Since v31, taproot is activated at genesis and no longer appears
67+ // as a deployment. Also in v31, Bitcoin Core added a "script_flags"
68+ // field to getdeploymentinfo which lists all the verification flags.
69+ hasFlag := false
70+ if info .ScriptFlags != nil {
71+ for _ , f := range info .ScriptFlags {
72+ if f == "TAPROOT" {
73+ hasFlag = true
74+ break
75+ }
76+ }
77+ }
78+
79+ return ok || hasFlag
6480}
You can’t perform that action at this time.
0 commit comments