File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package chainreg
22
33import (
44 "encoding/json"
5+ "slices"
56
67 "github.com/btcsuite/btcd/rpcclient"
78)
@@ -48,6 +49,7 @@ func backendSupportsTaproot(rpc *rpcclient.Client) bool {
4849 }
4950
5051 info := struct {
52+ ScriptFlags []string `json:"script_flags"`
5153 Deployments map [string ]struct {
5254 Type string `json:"type"`
5355 Active bool `json:"active"`
@@ -59,6 +61,14 @@ func backendSupportsTaproot(rpc *rpcclient.Client) bool {
5961 return false
6062 }
6163
64+ // Before Bitcoin Core v31, taproot was still included as a BIP9
65+ // deployment.
6266 _ , ok := info .Deployments ["taproot" ]
63- return ok
67+
68+ // Since v31, taproot is activated at genesis and no longer appears
69+ // as a deployment. Also in v31, Bitcoin Core added a "script_flags"
70+ // field to getdeploymentinfo which lists all the verification flags.
71+ hasFlag := slices .Contains (info .ScriptFlags , "TAPROOT" )
72+
73+ return ok || hasFlag
6474}
Original file line number Diff line number Diff line change 360360
361361## Code Health
362362
363+ * [ Update taproot detection] ( https://github.com/lightningnetwork/lnd/pull/10683 )
364+ to accommodate buried activation (and modified RPC ` getdeploymentinfo `
365+ response) beginning in Bitcoin Core v32.
366+
363367## Tooling and Documentation
364368
365369* [ Added missing ` lncli: ` tags] ( https://github.com/lightningnetwork/lnd/pull/10658 )
382386* Erick Cestari
383387* Gijs van Dam
384388* hieblmi
389+ * Matthew Zipkin
385390* Mohamed Awnallah
386391* Nishant Bansal
387392* Pins
You can’t perform that action at this time.
0 commit comments