From f9f41adddae2078eaec191403ecfe35e7027ce89 Mon Sep 17 00:00:00 2001
From: Daniel Cousens <github@dcousens.com>
Date: Wed, 6 Jan 2016 13:01:43 +1100
Subject: [PATCH] tests/integration: throw if no unspent is given

---
 test/integration/_blockchain.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/integration/_blockchain.js b/test/integration/_blockchain.js
index ac77e50..7af0ec3 100644
--- a/test/integration/_blockchain.js
+++ b/test/integration/_blockchain.js
@@ -27,6 +27,8 @@ testnet.faucet = function faucet (address, amount, done) {
           return unspent.value > 1e3
         }).pop()
 
+        if (!unspent) return callback(new Error('No unspent given'))
+
         testnet.transactions.get(unspent.txId, function (err, tx) {
           if (err) return callback(err)