romanz / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
1.02k stars 373 forks source link

Feature: in db use big-endian for height #966

Open RCasatta opened 7 months ago

RCasatta commented 7 months ago

This is not a big deal, as at the moment since I don't think pagination is supported.

However since the funding row has 8 bytes of script hash followed by 4 bytes of height encoded in little endian (the default for consensus encoding) the iteration of a script hash is not ordered by height.

While if the height would have been encoded in big endian it could have been possibile for example to iterate for most recent funding first.

romanz commented 6 months ago

Good idea, thanks! Let's keep it for the next index DB format update.