From e36757b4615b7c8eab7c254de5591922e72fec54 Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Fri, 25 Oct 2024 21:51:51 +0300 Subject: [PATCH] psbt: Add "fee" field accessor --- src/stdlib/psbt.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stdlib/psbt.rs b/src/stdlib/psbt.rs index 14ec63d..1b818bd 100644 --- a/src/stdlib/psbt.rs +++ b/src/stdlib/psbt.rs @@ -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; }