slickage / baron

Baron is a Bitcoin payment processor that anyone can deploy
163 stars 35 forks source link

Stop storing lastBlockHash in CouchDB #45

Closed wtogami closed 10 years ago

wtogami commented 10 years ago

Currently baron stores the last known blockhash in couchdb. It uses this blockhash on startup with listSinceBlock in order to process incoming payments that may have happened during downtime.

The way we are currently doing this non-ideal because it bloats couchdb with all the deletion and addition of a frequently changing record. Upon every new block it deletes the previous blockhash and adds the new record.

It turns out we do not need to store the last known block hash if we can obtain it from a different part of the database. For example, the most recent transaction blockhash fine to query with listSinceBlock.

Suggested Implementation