Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligaishun
chain33-pai
Commits
326e0f44
Commit
326e0f44
authored
Oct 09, 2019
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tx
parent
1d7a34e2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
raspConfig.go
models/raspConfig.go
+1
-1
transaction.go
models/transaction.go
+1
-1
No files found.
models/raspConfig.go
View file @
326e0f44
...
...
@@ -9,7 +9,7 @@ type RaspConfig struct {
// GetHeight get lastheight in chain33
func
GetHeight
()
(
int64
,
error
)
{
var
rasp
RaspConfig
err
:=
db
.
Select
(
"Height"
)
.
Where
(
"config = ?"
,
"height"
)
.
First
(
&
rasp
)
.
Error
err
:=
db
.
Model
(
&
RaspConfig
{}
)
.
Where
(
"config = ?"
,
"height"
)
.
First
(
&
rasp
)
.
Error
if
err
!=
nil
{
//if err == gorm.ErrRecordNotFound {
// return 0, err
...
...
models/transaction.go
View file @
326e0f44
...
...
@@ -11,7 +11,7 @@ func UpdateBlock(rt *RaspMinerTxs,rs *RaspMinerStat) error {
return
err
}
var
res
RaspMinerStat
if
err
:=
tx
.
Where
(
&
RaspMinerStat
{
Addr
:
rs
.
Addr
})
.
A
ttrs
(
&
rs
)
.
FirstOrCreate
(
&
res
)
.
Error
;
err
!=
nil
{
if
err
:=
tx
.
Where
(
&
RaspMinerStat
{
Addr
:
rs
.
Addr
})
.
A
ssign
(
&
rs
)
.
FirstOrCreate
(
&
res
)
.
Error
;
err
!=
nil
{
tx
.
Rollback
()
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment