db: use coins() with filter in list_spending_coins()
This commit is contained in:
parent
eeaf90e522
commit
c492c51f26
@ -422,13 +422,7 @@ impl SqliteConn {
|
|||||||
|
|
||||||
/// List coins that are being spent and whose spending transaction is still unconfirmed.
|
/// List coins that are being spent and whose spending transaction is still unconfirmed.
|
||||||
pub fn list_spending_coins(&mut self) -> Vec<DbCoin> {
|
pub fn list_spending_coins(&mut self) -> Vec<DbCoin> {
|
||||||
db_query(
|
self.coins(&[CoinStatus::Spending], &[])
|
||||||
&mut self.conn,
|
|
||||||
"SELECT * FROM coins WHERE spend_txid IS NOT NULL AND spend_block_time IS NULL",
|
|
||||||
rusqlite::params![],
|
|
||||||
|row| row.try_into(),
|
|
||||||
)
|
|
||||||
.expect("Db must not fail")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: don't take the whole coin, we don't need it.
|
// FIXME: don't take the whole coin, we don't need it.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user