Skip to content

Commit

Permalink
Fix read_transaction_memos
Browse files Browse the repository at this point in the history
  • Loading branch information
CriesofCarrots committed Oct 6, 2023
1 parent 0afd1b8 commit c0ded45
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2273,8 +2273,18 @@ impl Blockstore {
Ok(())
}

pub fn read_transaction_memos(&self, signature: Signature) -> Result<Option<String>> {
self.transaction_memos_cf.get(signature)
pub fn read_transaction_memos(
&self,
signature: Signature,
slot: Slot,
) -> Result<Option<String>> {
let memos = self.transaction_memos_cf.get((signature, slot))?;
if memos.is_none() {
self.transaction_memos_cf
.get_raw(&cf::TransactionMemos::deprecated_key(signature))
} else {
Ok(memos)
}
}

pub fn write_transaction_memos(
Expand Down Expand Up @@ -2735,7 +2745,7 @@ impl Blockstore {
let transaction_status =
self.get_transaction_status(signature, &confirmed_unrooted_slots)?;
let err = transaction_status.and_then(|(_slot, status)| status.status.err());
let memo = self.read_transaction_memos(signature)?;
let memo = self.read_transaction_memos(signature, slot)?;
let block_time = self.get_block_time(slot)?;
infos.push(ConfirmedTransactionStatusWithSignature {
signature,
Expand Down

0 comments on commit c0ded45

Please sign in to comment.