@@ -277,7 +277,10 @@ error::error_t CLASS::spent_prevout(const point_link& link, index index,
277277 // But if we hold the spend.pk/prevout.tx we can just read the
278278 // spend.hash/index, so we don't need to store the index, and we need to
279279 // read the spend.hash anyway, so index is free (no paging). So that's now
280- // just spend[4] + tx[4], back to 8 bytes (19GB).
280+ // just spend[4] + tx[4], back to 8 bytes (19GB). But getting spends is
281+ // relatively cheap, just search txs[hash] and navigate puts. The downside
282+ // is the extra search and puts is > 2x prevouts and can't be pruned.
283+ // The upside is half the prevout size (read/write/page) and store increase.
281284
282285 // Iterate points by point hash (of output tx) because may be conflicts.
283286 auto point = store_.point .it (get_point_key (link));
@@ -705,13 +708,14 @@ bool CLASS::set_unstrong(const header_link& link) NOEXCEPT
705708}
706709
707710TEMPLATE
708- bool CLASS::set_prevouts (const header_link& , const block&) NOEXCEPT
711+ bool CLASS::set_prevouts (size_t height , const block& block ) NOEXCEPT
709712{
710713 // ========================================================================
711714 const auto scope = store_.get_transactor ();
712715
713- // TODO: implement.
714- return {};
716+ // Clean single allocation failure (e.g. disk full).
717+ const table::prevout::record_put_ref prevouts{ {}, block };
718+ return store_.prevout .put (height, prevouts);
715719 // ========================================================================
716720}
717721
0 commit comments