diff --git a/doc/release-notes-35634.md b/doc/release-notes-35634.md new file mode 100644 index 00000000000..ccbd7fd7c22 --- /dev/null +++ b/doc/release-notes-35634.md @@ -0,0 +1,9 @@ +Indexes +------- + +- The transaction output spender index (`-txospenderindex`) now stores one byte + less per spender entry for newly indexed blocks. Existing indexes remain + compatible and no action is required. To apply the same saving to entries + indexed before upgrading, stop the node, delete the + `/indexes/txospenderindex/` directory, and restart with + `-txospenderindex` enabled to rebuild it. diff --git a/src/index/txospenderindex.cpp b/src/index/txospenderindex.cpp index 3d7b56b6a95..50b9bfeb8b5 100644 --- a/src/index/txospenderindex.cpp +++ b/src/index/txospenderindex.cpp @@ -23,15 +23,17 @@ #include #include +#include #include #include #include +#include #include #include #include /* The database is used to find the spending transaction of a given utxo. - * For every input of every transaction it stores a key that is a pair(siphash(input outpoint), transaction location on disk) and an empty value. + * For every input of every transaction it stores a key that is a pair(siphash(input outpoint), transaction location on disk) and a zero-byte value. * To find the spending transaction of an outpoint, we perform a range query on siphash(outpoint), and for each returned key load the transaction * and return it if it does spend the provided outpoint. */ @@ -91,8 +93,9 @@ void TxoSpenderIndex::WriteSpenderInfos(const std::vector{}); } m_db->WriteBatch(batch); }