From c0ded45b3ccc0e5b1d25ae327affa74ff885cfb2 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Fri, 6 Oct 2023 16:32:37 -0600 Subject: [PATCH] Fix read_transaction_memos --- ledger/src/blockstore.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 4f59ce2b7221e6..9b40c70e5a3e93 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -2273,8 +2273,18 @@ impl Blockstore { Ok(()) } - pub fn read_transaction_memos(&self, signature: Signature) -> Result> { - self.transaction_memos_cf.get(signature) + pub fn read_transaction_memos( + &self, + signature: Signature, + slot: Slot, + ) -> Result> { + 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( @@ -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,