From ee3bad52030068b450bc4528da57b74282e24345 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 8 Sep 2015 13:34:02 -0400 Subject: [PATCH] Added a check for the right number of tip events. - Since we have a spin lock that leads to the callback from a tip update, there could be cases where the callback assigned to a tip update isn't the one matching the last generate. - The architectural decision is to leave the spin lock in place to lower the number of possible callbacks for tip updates. --- integration/regtest.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration/regtest.js b/integration/regtest.js index e7f48287..1225e1ca 100644 --- a/integration/regtest.js +++ b/integration/regtest.js @@ -280,8 +280,10 @@ describe('Daemon Binding Functionality', function() { it('will get an event when the tip is new', function(done) { this.timeout(4000); bitcoind.on('tip', function(height) { - height.should.equal(151); - done(); + if (height == 151) { + height.should.equal(151); + done(); + } }); client.generate(1, function(err, response) { if (err) {