Skip to content

Commit aef7d64

Browse files
committed
Amend
1 parent 54d4219 commit aef7d64

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/index.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,12 +2404,12 @@ impl Index {
24042404
pub(crate) fn get_output_info(&self, outpoint: OutPoint) -> Result<Option<(api::Output, TxOut)>> {
24052405
let sat_ranges = self.list(outpoint)?;
24062406

2407-
let indexed;
24082407
let confirmations;
2408+
let indexed;
24092409
let spent;
2410+
let txout;
24102411

2411-
// make confirmations 0 for these
2412-
let txout = if outpoint == OutPoint::null() || outpoint == unbound_outpoint() {
2412+
if outpoint == OutPoint::null() || outpoint == unbound_outpoint() {
24132413
let mut value = 0;
24142414

24152415
if let Some(ranges) = &sat_ranges {
@@ -2421,11 +2421,10 @@ impl Index {
24212421
indexed = true;
24222422
confirmations = 0;
24232423
spent = true;
2424-
2425-
TxOut {
2424+
txout = TxOut {
24262425
value: Amount::from_sat(value),
24272426
script_pubkey: ScriptBuf::new(),
2428-
}
2427+
};
24292428
} else {
24302429
indexed = self.contains_output(&outpoint)?;
24312430

@@ -2435,11 +2434,10 @@ impl Index {
24352434
{
24362435
spent = false;
24372436
confirmations = result.confirmations;
2438-
2439-
TxOut {
2437+
txout = TxOut {
24402438
value: result.value,
24412439
script_pubkey: ScriptBuf::from_bytes(result.script_pub_key.hex),
2442-
}
2440+
};
24432441
} else {
24442442
spent = true;
24452443

@@ -2451,10 +2449,10 @@ impl Index {
24512449

24522450
confirmations = result.confirmations.unwrap_or(0);
24532451

2454-
TxOut {
2452+
txout = TxOut {
24552453
value: output.value,
24562454
script_pubkey: ScriptBuf::from_bytes(output.script_pub_key.hex),
2457-
}
2455+
};
24582456
}
24592457
};
24602458

0 commit comments

Comments
 (0)