Neptune-Crypto / neptune-core

anonymous peer-to-peer cash
Apache License 2.0
23 stars 7 forks source link

Write to disk all UTXO notifications that come from own client #137

Open Sword-Smith opened 2 months ago

Sword-Smith commented 2 months ago

As I realized when discussing #136 we don't store UTXO notifications to disks. This means that if a client creates a transaction with a change UTXO and then shuts down before this transaction is included in a block, the change UTXO is not discovered by the client. #5 aims to address this issue in a fully recoverable fool proof way, but I think we should also just store the UTXO notifications to disk, iff they are worthy of storing to disk, that is -- this could be that they have a sufficiently high credibility, or, preferably just that they originate from the running instance, i.e. are of type UtxoNotifier::OwnMiner, UtxoNotifier::Cli, or UtxoNotifier::Myself.

dan-da commented 2 months ago

yeah, so here I am asking:

  1. why a change UTXO is treated differently from any other incoming UTXO
  2. why a change UTXO is treated differently from a UTXO that I am sending to my own wallet address, eg if splitting an existing wallet UTXO.

It seems we have two different ways of processing incoming UTXOs: expected_utxos and announcements. I presume there is a good reason, but I'd like to have a more thorough understanding before making any changes, especially as the asymmetry highlighted in (2) bothers me.

And generally it just seems simpler and easier to maintain to have a single mechanism.