Skip to content

Commit bf12f5d

Browse files
committed
add: transaction fee to output
1 parent f410a54 commit bf12f5d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ struct ResultRow {
5555
vsize: usize,
5656
inputs: usize,
5757
outputs: usize,
58+
fee: u64,
5859
}
5960

6061
fn main() {
@@ -124,6 +125,11 @@ fn main() {
124125
continue;
125126
}
126127

128+
let info = data_node
129+
.get_raw_transaction_info_with_fee(&tx.txid(), Some(&block_hash))
130+
.unwrap();
131+
let fee = info.fee.unwrap_or_default();
132+
127133
// When using -stopatheight=X, Bitcoin Core might already know
128134
// about blocks at a height >X. In this case, transactions are
129135
// rejected because they are "already known" (as the blocks
@@ -137,6 +143,7 @@ fn main() {
137143
vsize: tx.vsize(),
138144
inputs: tx.input.len(),
139145
outputs: tx.output.len(),
146+
fee: fee.to_sat(),
140147
});
141148
} else {
142149
test_node

0 commit comments

Comments
 (0)