From c852372559977bd463c171d3cc362752dc7eceb5 Mon Sep 17 00:00:00 2001
From: Daniel Cousens <github@dcousens.com>
Date: Tue, 18 Apr 2017 13:43:26 +1000
Subject: [PATCH] tests: add a timeout to let the backend keep up

---
 test/integration/_blockchain.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/integration/_blockchain.js b/test/integration/_blockchain.js
index f17c1b8..3a93a44 100644
--- a/test/integration/_blockchain.js
+++ b/test/integration/_blockchain.js
@@ -33,9 +33,14 @@ function fundAddress (unspents, outputs, callback) {
   var txId = tx.getId()
 
   testnet.transactions.propagate(tx.toHex(), function (err) {
-    callback(err, outputs.map(function (x, i) {
-      return { txId: txId, vout: i }
-    }))
+    if (err) return callback(err)
+
+    // FIXME: @blocktrail can be very slow, give it time
+    setTimeout(() => {
+      callback(null, outputs.map(function (x, i) {
+        return { txId: txId, vout: i }
+      }))
+    }, 3000)
   })
 }