Skip to content

Commit 0b69834

Browse files
committed
Adding threshold error on exceeding 1000 ways
Signed-off-by: Harshil Jani <[email protected]>
1 parent 37d6a3d commit 0b69834

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/descriptor/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ impl Descriptor<DescriptorPublicKey> {
617617

618618
/// Get all possible assets for a given descriptor
619619
pub fn all_assets(&self) -> Result<Vec<Assets>, Error> {
620+
let threshold = self.count_assets();
621+
if threshold >= 1000 {
622+
return Err(Error::MaxAssetThresholdExceeded);
623+
}
620624
match self {
621625
Descriptor::Bare(k) => Ok(k.as_inner().all_assets()),
622626
Descriptor::Pkh(k) => {

0 commit comments

Comments
 (0)