move master_private_keys and master_public_keys to NewWallet
[electrum-nvc.git] / lib / plugins.py
index 700dbc2..feea2fc 100644 (file)
@@ -34,7 +34,7 @@ def run_hook(name, *args):
     
     global plugins
 
-    found = 0
+    results = []
 
     for p in plugins:
 
@@ -45,15 +45,18 @@ def run_hook(name, *args):
         if not callable(f):
             continue
 
-        found += 1
-
         try:
-            f(*args)
+            r = f(*args)
         except Exception:
             print_error("Plugin error")
             traceback.print_exc(file=sys.stdout)
-            
-    return found
+
+        if r:
+            results.append(r)
+
+    if results:
+        assert len(results) == 1, results
+        return results[0]