Skip to content

Commit a2d6fff

Browse files
committed
Merge #343: Use rust-bitcoin taproot max node count constant
b907cad Use rust-bitcoin taproot max node count constant (Duncan Dean) Pull request description: Fixes #334 ACKs for top commit: sanket1729: utACK b907cad apoelstra: ACK b907cad Tree-SHA512: 6b91917ebca1a1f971736fc52b580a0dbb749f033f2b23ece9e87a420e678b1edff54ffdc9258eebbf244ca091b9d52f536d531b75cd6250dd0dafe31cece3d0
2 parents d8cc633 + b907cad commit a2d6fff

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/descriptor/tr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use super::checksum::{desc_checksum, verify_checksum};
99
use bitcoin::blockdata::opcodes;
1010
use bitcoin::util::taproot::{
1111
LeafVersion, TaprootBuilder, TaprootBuilderError, TaprootSpendInfo, TAPROOT_CONTROL_BASE_SIZE,
12-
TAPROOT_CONTROL_NODE_SIZE,
12+
TAPROOT_CONTROL_MAX_NODE_COUNT, TAPROOT_CONTROL_NODE_SIZE,
1313
};
1414
use bitcoin::{self, secp256k1, Script};
1515
use errstr;
1616
use expression::{self, FromTree};
17-
use miniscript::{limits::TAPROOT_MAX_NODE_COUNT, Miniscript};
17+
use miniscript::Miniscript;
1818
use std::cmp::{self, max};
1919
use std::hash;
2020
use std::sync::{Arc, Mutex};
@@ -173,7 +173,7 @@ impl<Pk: MiniscriptKey> Tr<Pk> {
173173
pub fn new(internal_key: Pk, tree: Option<TapTree<Pk>>) -> Result<Self, Error> {
174174
let nodes = tree.as_ref().map(|t| t.taptree_height()).unwrap_or(0);
175175

176-
if nodes <= TAPROOT_MAX_NODE_COUNT {
176+
if nodes <= TAPROOT_CONTROL_MAX_NODE_COUNT {
177177
Ok(Self {
178178
internal_key,
179179
tree,

src/miniscript/limits.rs

-3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,3 @@ pub const MAX_BLOCK_WEIGHT: usize = 4000000;
5050
/// Maximum pubkeys as arguments to CHECKMULTISIG
5151
// https://github.com/bitcoin/bitcoin/blob/6acda4b00b3fc1bfac02f5de590e1a5386cbc779/src/script/script.h#L30
5252
pub const MAX_PUBKEYS_PER_MULTISIG: usize = 20;
53-
/// Maximum number of scripts allowed by standardness rules in TapTree format
54-
// https://github.com/bitcoin/bitcoin/blob/81f4a3e84d6f30e7b12a9605dabc3359f614da93/src/script/interpreter.h#L229
55-
pub const TAPROOT_MAX_NODE_COUNT: usize = 128;

0 commit comments

Comments
 (0)