Skip to content

Commit e06c3f9

Browse files
Set tx field to none if include_raw is false
`del_tx` pulls the TransactionDetails object using `select_transaction_details_by_txid` method which gets the transaction details' data with a non-None transaction field even if the `include_raw` argument is `false`. So it becomes necessary to Set the transaction field in transactiondetails to None in `del_tx`, when we make a call to it with `include_raw=false`.
1 parent 06310f1 commit e06c3f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/database/sqlite.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,13 @@ impl BatchOperations for SqliteDatabase {
744744
include_raw: bool,
745745
) -> Result<Option<TransactionDetails>, Error> {
746746
match self.select_transaction_details_by_txid(txid)? {
747-
Some(transaction_details) => {
747+
Some(mut transaction_details) => {
748748
self.delete_transaction_details_by_txid(txid)?;
749749

750750
if include_raw {
751751
self.delete_transaction_by_txid(txid)?;
752+
} else {
753+
transaction_details.transaction = None;
752754
}
753755
Ok(Some(transaction_details))
754756
}

0 commit comments

Comments
 (0)