Skip to content

Commit

Permalink
Merge pull request #1164 from nervosnetwork/fix-tx-not-all
Browse files Browse the repository at this point in the history
fix: the missing txs
  • Loading branch information
ashchan authored Nov 28, 2019
2 parents 908c202 + 43edefe commit 04c7d3c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ export default class AddressCreatedSubject {
static getSubject() {
return this.subject
}

static setSubject(subject: ReplaySubject<Address[]>) {
this.subject = subject
}
}
5 changes: 3 additions & 2 deletions packages/neuron-wallet/src/services/sync/block-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ export default class BlockListener {
}

public setLockHashes = (lockHashes: string[]) => {
this.lockHashes = lockHashes
const hashes = [...new Set(lockHashes)]
this.lockHashes = hashes
if (!this.queue) {
return
}
this.queue.setLockHashes(lockHashes)
this.queue.setLockHashes(hashes)
}

public appendLockHashes = (lockHashes: string[]) => {
Expand Down
5 changes: 4 additions & 1 deletion packages/neuron-wallet/src/startup/sync-block-task/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import Utils from 'services/sync/utils'
import { switchNetwork as syncSwitchNetwork } from './sync'
import { switchNetwork as indexerSwitchNetwork } from './indexer'
import { DatabaseInitParams } from './create'
import AddressCreatedSubject from 'models/subjects/address-created-subject'

// register to listen address updates
registerAddressListener()

const { addressesUsedSubject, databaseInitSubject } = remote.require('./startup/sync-block-task/params')
const { addressesUsedSubject, databaseInitSubject, addressCreatedSubject } = remote.require('./startup/sync-block-task/params')

AddressCreatedSubject.setSubject(addressCreatedSubject)

// pass to task a main process subject
AddressesUsedSubject.setSubject(addressesUsedSubject)
Expand Down

0 comments on commit 04c7d3c

Please sign in to comment.