Skip to content

Commit cb04748

Browse files
authored
Merge pull request #10683 from pinheadmz/bury-taproot-deployment
chainreg: accommodate buried taproot deployment in Bitcoin Core v31
2 parents 97fd0aa + 3963905 commit cb04748

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

chainreg/taproot_check.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package chainreg
22

33
import (
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
}

docs/release-notes/release-notes-0.21.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@
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)
@@ -382,6 +386,7 @@
382386
* Erick Cestari
383387
* Gijs van Dam
384388
* hieblmi
389+
* Matthew Zipkin
385390
* Mohamed Awnallah
386391
* Nishant Bansal
387392
* Pins

0 commit comments

Comments
 (0)