From 0b82a05a75a0a7592e4fe391120f90d7cee495ac Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Sat, 31 Jan 2015 04:09:48 +0100 Subject: events --- lib/web3.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/web3.js') diff --git a/lib/web3.js b/lib/web3.js index 6bf8f7bc0..88dc6931b 100644 --- a/lib/web3.js +++ b/lib/web3.js @@ -282,7 +282,10 @@ var web3 = { /// @param filter may be a string, object or event /// @param indexed is optional, this may be an object with optional event indexed params watch: function (filter, indexed) { - return new web3.filter(filter, indexed, ethWatch); + if (filter._isEvent) { + return filter(indexed); + } + return new web3.filter(filter, ethWatch); } }, @@ -293,9 +296,8 @@ var web3 = { shh: { /// @param filter may be a string, object or event - /// @param indexed is optional, this may be an object with optional event indexed params watch: function (filter, indexed) { - return new web3.filter(filter, indexed, shhWatch); + return new web3.filter(filter, shhWatch); } }, -- cgit v1.2.3