iotaledger / curl.lib.js

IOTA Proof-of-Work algorithm ported to Javascript to work in WebGL2-enabled browsers
GNU General Public License v3.0
37 stars 31 forks source link

_save is called incorrectly when search is interrupted #27

Open obany opened 6 years ago

obany commented 6 years ago

If you interrupt a PearlDiver search the code attempts to call the _save method, but is accesses it as an instance methods instead of passing the instance.

https://github.com/iotaledger/curl.lib.js/blob/2da1de36123d89b0c7dcababe24f72828bc5f794/src/pearldiver.js#L100

Should be if(instance.state == PDState.INTERRUPTED) return _save(instance, searchObject);