Skip to content

Commit

Permalink
ledger: Return Txid in add_transaction_unconditionally.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Jun 12, 2024
1 parent 0d0549c commit e6cc3e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ledger/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ impl Ledger {
pub fn add_transaction_unconditionally(
&self,
transaction: Transaction,
) -> Result<(), LedgerError> {
) -> Result<Txid, LedgerError> {
self.database
.lock()
.unwrap()
.insert_transaction_unconditionally(&transaction)?;

add_item!(self.transactions, transaction);
add_item!(self.transactions, transaction.clone());

Ok(())
Ok(transaction.compute_txid())
}
/// Returns user's list of transactions.
pub fn get_transaction(&self, txid: Txid) -> Result<Transaction, LedgerError> {
Expand Down

0 comments on commit e6cc3e9

Please sign in to comment.