Currently we pass a Vec. This requires an extra allocation and copy of all elements if a caller doesn't have a Vec already, which is at least 95% of cases.
Another, a smaller issue, we have a function util::to_hex and some structs implement to_hex() on top of it, so we have a mix of it in the code. This PR introduces a trait and a blanket impl for AsRef<[u8]> which brings a uniform API (obj.to_hex()). One unfortunate case is arrays of size bigger than 32 - Rust doesn't implement AsRef for them so it requires an ugly hack (&array[..]).to_hex().
* Refactor SyncState
Method sync_error() retrun type was simplified.
update_txhashset_download() was made type safe, which eliminates a runtime enum variant's check, added an atomic status update
We allocate 17 vectors (in the heap) per 512 headers, this PR reduces the number to 1 by resuing the buffer for headers and eliminating the need in the vector of indices
* Node API: don't error on missing output
* Propagate errors from get_output*
* Rename is_unspent and small refactor
* Forgot to rename function in tests
* Change Batch get_output_pos_height type signature
* no need to rehash with index to compare output with input spending it
* compare output identifier when checking is_unspent()
* output identifier from cleanup
* first pass at rewind_single_block
and reworking rewind to simply iterate over blocks, rewinding each incrementally
* commit
* commit
* cleanup
* add test coverage for output_pos index transactional semantics during rewind
* commit
* do not store commitments in spent_index
just use the order of the inputs in the block
* compare key with commitment when cleaning output_pos index
* remove unused OutputPos struct
* feat: allow DNS names in peers/seeds list and resolve them
* tests: add mod for peer tests
* refactor: rename some variables
* chore: use Serde desrialize to resolve DNS names into PeerAddrs
* fix: compile
* fix: add back code to remove duplicate ip addresses from resolved DNS seeds
* Update intro.md
Significant clarifications, especially in the paragraph where excess value is introduced and the section about kernel offsets.
* fix and clarify section about kernel offsets
"Splitting" the blinding factor into *k1* and *k2* is unnecessarily confusing I think. The excess and the offset are really two arbitrary numbers without any mathematical relation to each other. I think I rephrased the section as well as I could without sacrificing any correctness for the sake of simplicity (which I think would be more confusing than helpful).
* do the same fixes for the Swedish version
* small fix regarding aggregation
Transactions are not aggregated by non-mining nodes as well. Removed the part about miners.
Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>