hypercore-protocol / hypercore-next

Hypercore 10 is an append only log with multi-writer primitives built in.
MIT License
150 stars 15 forks source link

set `opened=false` in `_close()` method #85

Closed agrathwohl closed 2 years ago

agrathwohl commented 2 years ago

On the current master branch, a closed hypercore will still display opened=true in addition to closed=true. This PR sets the opened property to false, which resolves the issue for me.

mafintosh commented 2 years ago

Thanks. Curious, what do you use the property for in practice?

agrathwohl commented 2 years ago

I am working on a project which uses hypercore v10 to represent wav audio files for p2p podcast productions. We also make use of your fabulous nanoresource, in addition to nanoprocess and the little-media-box library I helped develop with @jwerle.

We do some sanity checks in the code to make sure that the hypercore is opened only after the underlying nanoresource from which it derives is opened first. That's where we spotted the anomaly.

mafintosh commented 2 years ago

Nice, I’m finishing a massive refactor of the replication engine (see the pr if you are interested). Once that lands plus some minor other things we’re going stable.