Skip to content

Commit

Permalink
handles new block height field
Browse files Browse the repository at this point in the history
  • Loading branch information
PanchoBubble committed Dec 23, 2024
1 parent 477e4d4 commit 3690857
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/hooks/mining/useTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ export default function useFetchTx() {
const txs = await invoke('get_transaction_history');
const sortedTransactions = txs.sort((a, b) => b.timestamp - a.timestamp);
const mapped = sortedTransactions?.map((tx) => {
const blockHeight = tx.message.split(': ')[1];

if (blockHeight) {
return { ...tx, blockHeight };
}

return tx;
return { ...tx, blockHeight: tx.mined_in_block_height };
}) as Transaction[];

if (mapped?.length) {
Expand Down
1 change: 1 addition & 0 deletions src/types/app-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export interface TransactionInfo {
timestamp: number;
message: string;
payment_id: string;
mined_in_block_height?: number;
}

export interface P2poolStatsResult {
Expand Down

0 comments on commit 3690857

Please sign in to comment.