Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
acde9cd0
Commit
acde9cd0
authored
8 years ago
by
Ethan Buchman
Browse files
Options
Downloads
Patches
Plain Diff
count txs
parent
8e4a3956
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tmsp/erisdb.go
+9
-1
9 additions, 1 deletion
tmsp/erisdb.go
with
9 additions
and
1 deletion
tmsp/erisdb.go
+
9
−
1
View file @
acde9cd0
...
...
@@ -35,6 +35,8 @@ type ErisDBApp struct {
// client to the tendermint core rpc
client
*
client
.
ClientURI
host
string
// tendermint core endpoint
nTxs
int
// count txs in a block
}
func
(
app
*
ErisDBApp
)
GetState
()
*
sm
.
State
{
...
...
@@ -96,6 +98,8 @@ func (app *ErisDBApp) SetOption(key string, value string) (log string) {
// Implements tmsp.Application
func
(
app
ErisDBApp
)
AppendTx
(
txBytes
[]
byte
)
(
res
tmsp
.
Result
)
{
app
.
nTxs
+=
1
// XXX: if we had tx ids we could cache the decoded txs on CheckTx
var
n
int
var
err
error
...
...
@@ -149,8 +153,12 @@ func (app *ErisDBApp) Commit() (res tmsp.Result) {
// sync the AppendTx cache
app
.
cache
.
Sync
()
// if there were any txs in the block,
// reset the check cache to the new height
app
.
checkCache
=
sm
.
NewBlockCache
(
app
.
state
)
if
app
.
nTxs
>
0
{
app
.
checkCache
=
sm
.
NewBlockCache
(
app
.
state
)
}
app
.
nTxs
=
0
// save state to disk
app
.
state
.
Save
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment