Skip to content

Commit

Permalink
more time (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
rllola authored Jul 20, 2022
1 parent e89966a commit de11867
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/spvnode/spvnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class SPVNode extends EventEmitter {
this.height = 0
this.bestHeight = 0
// Caching merkle block height for faster update
// FIXME: should be merkle count and not height. We can receive it in an incorrect order...
this.merkleHeight = 0
// Count number of merkle block received before getting next round
this.merkleBlockCount = 0
Expand Down Expand Up @@ -489,7 +488,7 @@ class SPVNode extends EventEmitter {
// This should be done once we have cleared all the merkle blocks
this._sendGetBlocks([this.merkleBlockNextHash])

// Update cache only when we verifly all the merkle blocks from the inv call
// Update cache only when we verified all the merkle blocks from the inv call
this.merkleBlockBatchSize = 0
this.merkleHeight = header.height
this.merkleHash = header.hash
Expand Down
7 changes: 3 additions & 4 deletions test/integration/resync.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.serial('should sync all the transactions', async t => {
wallet.addTxToWallet(tx)
})

spvnode.on('synchronized', function (newData) {
spvnode.on('synchronized', async function (newData) {
t.log('Our node is synchronized')
})

Expand All @@ -64,11 +64,10 @@ test.serial('should sync all the transactions', async t => {
await spvnode.addPeer(settings.NODE_IP, settings.DEFAULT_PORT)

await spvnode.start()
t.log('staring synchroniztaion')
await spvnode.synchronize()

await new Promise(resolve => setTimeout(resolve, 1000))

await spvnode.shutdown()
await new Promise(resolve => setTimeout(resolve, 10000))

const balance = await wallet.getBalance()

Expand Down

0 comments on commit de11867

Please sign in to comment.