0xB10C / bademeister-go

Implementation of Bademeister, a mempool watcher and recorder, in Golang.
0 stars 3 forks source link

Add Mempool #43

Closed OttoAllmendinger closed 4 years ago

OttoAllmendinger commented 4 years ago

A Mempool can be constructed using

The mempool transactions can be queried using Transactions() []types.Transaction.

The next Mempool change can be queried using NextEvent() (Event, error). The Event contains the transactions that are added and removed.

The Mempool resulting from that Event can be derived using ApplyEvent(event) error

A mempool for a time t is reconstructed by querying all transactions with tx.FirstSeen <= t < t.LastRemoved.

If the best block at the queried time was reorged (unlikely), a mempool is constructed at the common ancestor block and updated until the requested time is reached.

OttoAllmendinger commented 4 years ago

will rebase this on #44