-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GetBalance to CoinView #995
Conversation
Still testing. |
|
||
if (row == null) | ||
throw new InvalidOperationException($"No rewind data found for block at height {height}."); | ||
|
||
batch.Delete(BitConverter.GetBytes(height)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix - the table prefix is missing here and the bytes should be in big endian order.
src/Stratis.Bitcoin.Features.Consensus/CoinViews/Coindb/LeveldbCoindb.cs
Outdated
Show resolved
Hide resolved
Hi Gustav, release 1.3 will go out tomorrow as we are already in RC with the masternodes. Can you please point this to https://github.com/stratisproject/StratisFullNode/tree/release/1.3.1.0 |
See #1031 |
Merge PR #110 first.
Implements a very fast
IEnumerable<(uint height, long satoshis)> GetBalance(TxDestination txDestination);
The first enumeration value comes from the
Balance
table and subsequent values are adjusted via theBalanceAdjustment
table.Only a fraction of a second (~40 ms) response time was observed to return ~1800 balance adjustments all the way to genesis.
Implemented ONCE in
Coindb<T>
which replacesLevelDbCoindb
andRocksDbCoindb
.The code deals with the following issues:
AddressIndexer
withAddressIndexerCV
and respecting the-addressindex
setting.IDb
compliant wrapper classesRocksDb
andLevelDb
.Instead of adding migration code the coin database is automatically truncated and re-built (+- 5 minutes).