LLFourn / bdk_core_staging

Staging area for bdk_core initial development
15 stars 12 forks source link

Add KeychainTxOutIndex::reserve_next_unused_spk #188

Closed LLFourn closed 1 year ago

LLFourn commented 1 year ago

Just like next_unused_spk but also marks it as used with mark_used. It's annoying to do this in two steps outside because of mutable borrow issues.

Should also have one for revealing and reserving at the same time.

Alternatively we could have returned owned Scripts from all spk APIs. I liked returning references because it demonstrates what is actually stored in the index and what is being derived on the fly.