We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d0549c commit e6cc3e9Copy full SHA for e6cc3e9
src/ledger/transactions.rs
@@ -18,15 +18,15 @@ impl Ledger {
18
pub fn add_transaction_unconditionally(
19
&self,
20
transaction: Transaction,
21
- ) -> Result<(), LedgerError> {
+ ) -> Result<Txid, LedgerError> {
22
self.database
23
.lock()
24
.unwrap()
25
.insert_transaction_unconditionally(&transaction)?;
26
27
- add_item!(self.transactions, transaction);
+ add_item!(self.transactions, transaction.clone());
28
29
- Ok(())
+ Ok(transaction.compute_txid())
30
}
31
/// Returns user's list of transactions.
32
pub fn get_transaction(&self, txid: Txid) -> Result<Transaction, LedgerError> {
0 commit comments