Skip to content

Commit 0453428

Browse files
committed
pset: input: handle blinded_issuance
1 parent 1bde7a1 commit 0453428

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/pset/error.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ pub enum PsetBlindError {
250250
ConfidentialTxOutError(usize, ConfidentialTxOutError),
251251
/// Blinding proof creation error
252252
BlindingProofsCreationError(usize, secp256k1_zkp::Error),
253+
/// Blinding issuance unsupported
254+
BlindingIssuanceUnsupported(usize),
253255
}
254256

255257
impl fmt::Display for PsetBlindError {
@@ -291,6 +293,9 @@ impl fmt::Display for PsetBlindError {
291293
e, i
292294
)
293295
}
296+
PsetBlindError::BlindingIssuanceUnsupported(i) => {
297+
write!(f, "Blinding issuance is not supported, set blinded_issuance to 0 at input index {}", i)
298+
}
294299
}
295300
}
296301
}

src/pset/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ impl PartiallySignedTransaction {
373373
),
374374
PsetBlindError,
375375
> {
376+
for (i, inp) in self.inputs.iter().enumerate() {
377+
if inp.has_issuance() && inp.blinded_issuance.unwrap_or(1) == 1 {
378+
return Err(PsetBlindError::BlindingIssuanceUnsupported(i));
379+
}
380+
}
376381
let mut blind_out_indices = Vec::new();
377382
for (i, out) in self.outputs.iter().enumerate() {
378383
if out.blinding_key.is_none() {

0 commit comments

Comments
 (0)