Skip to content

Commit

Permalink
fix: skip get previous tx when cellbase in indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Nov 7, 2019
1 parent 41600ea commit 7e8a578
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/neuron-wallet/src/services/indexer/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default class IndexerQueue {

private url: string

private emptyTxHash = '0x' + '0'.repeat(64)

constructor(url: string, lockHashInfos: LockHashInfo[], tipNumberSubject: Subject<string | undefined>) {
this.lockHashInfos = lockHashInfos
this.url = url
Expand Down Expand Up @@ -213,6 +215,9 @@ export default class IndexerQueue {
if (!txEntity || !txEntity.blockHash) {
if (!txEntity) {
for (const input of transaction.inputs!) {
if (input.previousOutput!.txHash === this.emptyTxHash) {
continue
}
const previousTxWithStatus = await this.getBlocksService.getTransaction(input.previousOutput!.txHash)
const previousTx = TypeConvert.toTransaction(previousTxWithStatus.transaction)
const previousOutput = previousTx.outputs![+input.previousOutput!.index]
Expand Down

0 comments on commit 7e8a578

Please sign in to comment.