fix: block error

This commit is contained in:
Alisa | Side.one 2023-05-10 00:30:33 +08:00
parent 22987636a8
commit af457a3a95

View File

@ -23,12 +23,16 @@ export const useBlockModule = defineStore('blockModule', {
txsInRecents() {
const txs = [] as { hash: string; tx: DecodedTxRaw }[];
this.recents.forEach((x) =>
x.block?.data?.txs.forEach((tx: Uint8Array) =>
txs.push({
hash: hashTx(tx),
tx: decodeTxRaw(tx),
})
)
x.block?.data?.txs.forEach((tx: Uint8Array) => {
if (tx) {
try {
txs.push({
hash: hashTx(tx),
tx: decodeTxRaw(tx),
});
} catch (e) {}
}
})
);
return txs;
},