Neptune-Crypto / neptune-core

anonymous peer-to-peer cash
Apache License 2.0
27 stars 8 forks source link

Prune Abandoned UTXOs #17

Open aszepieniec opened 1 year ago

aszepieniec commented 1 year ago

The node periodically runs a maintenance task to try to synchronize the membership proofs of owned UTXOs. But when the owned UTXOs live on an abandoned chain whose last common ancestor with the canonical one was deep enough, it's probably better to delete them.

Sword-Smith commented 1 year ago

We're using DbtVec to store monitored UTXOs. And we cannot delete from the middle of a list, we only have a pop method to delete from the end of a list. Intead, I suggest we mark MonitoredUtxo in the database as abandoned and adapt the rest of the logic to deal with that.