Skip to content

Commit

Permalink
psbt: Add "fee" field accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
shesek committed Oct 25, 2024
1 parent 6b3a60f commit e36757b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stdlib/psbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,12 @@ impl FieldAccess for Psbt {
"xpub" => self.xpub.into(),
"unknown" => self.unknown.into(),
"proprietary" => self.proprietary.into(),
"fee" => {
let fee = self.fee().ok();
fee.and_then(|f| f.to_sat().try_into().ok())
.unwrap_or(-1i64)
.into()
}
_ => {
return None;
}
Expand Down

0 comments on commit e36757b

Please sign in to comment.