Skip to content

Commit

Permalink
Merge pull request #157 from crisdut/fix/rgb-inputs
Browse files Browse the repository at this point in the history
Mark as rgb-consumer only transition inputs
  • Loading branch information
dr-orlovsky authored May 1, 2024
2 parents ce07eb7 + 326112d commit 0f65b19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions psbt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ impl RgbPsbt for Psbt {
let contract_id = info.transition.contract_id;
let mut inputs = info.inputs.into_inner();
for input in self.inputs_mut() {
inputs.remove(&XChain::Bitcoin(input.prevout().outpoint()));
input
.set_rgb_consumer(contract_id, info.id)
.map_err(|_| EmbedError::PsbtRepeatedInputs)?;
if inputs.remove(&XChain::Bitcoin(input.prevout().outpoint())) {
input
.set_rgb_consumer(contract_id, info.id)
.map_err(|_| EmbedError::PsbtRepeatedInputs)?;
}
}
if !inputs.is_empty() {
return Err(EmbedError::AbsentInputs);
Expand Down

0 comments on commit 0f65b19

Please sign in to comment.