Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
03270ff2
Commit
03270ff2
authored
Feb 05, 2021
by
jiangpeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into add-dapp-vote
parents
004e6d2a
5788d69f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
23 deletions
+20
-23
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-0
Makefile
plugin/Makefile
+0
-4
privacy.go
plugin/dapp/privacy/wallet/privacy.go
+17
-5
privacystore.go
plugin/dapp/privacy/wallet/privacystore.go
+0
-13
No files found.
go.mod
View file @
03270ff2
...
...
@@ -3,7 +3,7 @@ module github.com/33cn/plugin
go 1.12
require (
github.com/33cn/chain33 v1.65.1-0.202101
15070259-1e4df1700e2e
github.com/33cn/chain33 v1.65.1-0.202101
26054237-998e3aae5318
github.com/BurntSushi/toml v0.3.1
github.com/NebulousLabs/Sia v1.3.7
github.com/NebulousLabs/errors v0.0.0-20181203160057-9f787ce8f69e // indirect
...
...
go.sum
View file @
03270ff2
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/33cn/chain33 v1.65.1-0.20210115070259-1e4df1700e2e h1:VuKDED/KY1G+cErADqu1L5uKW+m/5JfYeapHycAUEJc=
github.com/33cn/chain33 v1.65.1-0.20210115070259-1e4df1700e2e/go.mod h1:XEhB5IOpLl42xM37TpYzFNJg48U4cYIe7dZVmNA/78Y=
github.com/33cn/chain33 v1.65.1-0.20210126054237-998e3aae5318 h1:lLkGn0FxMM1Z3uAMBx2KAgICOLRGrCojmtX8eCht+Fk=
github.com/33cn/chain33 v1.65.1-0.20210126054237-998e3aae5318/go.mod h1:XEhB5IOpLl42xM37TpYzFNJg48U4cYIe7dZVmNA/78Y=
github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
...
...
plugin/Makefile
deleted
100644 → 0
View file @
004e6d2a
all
:
go get
-v
-u
gitlab.33.cn/chain33/chain33
go build
-i
-o
tool github.com/33cn/chain33/cmd/tools
./tool import
--path
"."
--packname
"github.com/33cn/plugin"
--conf
""
--out
"plugin.toml"
plugin/dapp/privacy/wallet/privacy.go
View file @
03270ff2
...
...
@@ -1010,14 +1010,26 @@ func (policy *privacyPolicy) buildAndStoreWalletTxDetail(param *buildStoreWallet
}
func
(
policy
*
privacyPolicy
)
checkExpireFTXOOnTimer
()
{
operater
:=
policy
.
getWalletOperate
()
header
:=
operater
.
GetLastHeader
()
header
:=
policy
.
getWalletOperate
()
.
GetLastHeader
()
if
header
==
nil
{
bizlog
.
Error
(
"checkExpireFTXOOnTimer Can not get last header."
)
return
}
policy
.
store
.
moveFTXO2UTXOWhenFTXOExpire
(
header
.
Height
,
header
.
BlockTime
)
curFTXOTxs
,
keys
:=
policy
.
store
.
getFTXOlist
()
if
len
(
curFTXOTxs
)
==
0
{
return
}
dbbatch
:=
policy
.
store
.
NewBatch
(
true
)
for
i
,
ftxo
:=
range
curFTXOTxs
{
if
!
ftxo
.
IsExpire
(
header
.
GetHeight
(),
header
.
GetBlockTime
())
{
continue
}
policy
.
store
.
moveFTXO2UTXO
(
keys
[
i
],
dbbatch
)
bizlog
.
Debug
(
"moveFTXO2UTXOWhenFTXOExpire"
,
"moveFTXO2UTXO key"
,
string
(
keys
[
i
]),
"expire ftxo"
,
ftxo
)
}
err
:=
dbbatch
.
Write
()
if
err
!=
nil
{
bizlog
.
Error
(
"checkExpireFTXOOnTimer"
,
"db write err"
,
err
)
}
}
func
(
policy
*
privacyPolicy
)
checkWalletStoreData
()
{
...
...
plugin/dapp/privacy/wallet/privacystore.go
View file @
03270ff2
...
...
@@ -963,16 +963,3 @@ func (store *privacyStore) moveSTXO2FTXO(tx *types.Transaction, txhash string, n
newbatch
.
Write
()
return
nil
}
func
(
store
*
privacyStore
)
moveFTXO2UTXOWhenFTXOExpire
(
blockheight
,
blocktime
int64
)
{
dbbatch
:=
store
.
NewBatch
(
true
)
curFTXOTxs
,
keys
:=
store
.
getFTXOlist
()
for
i
,
ftxo
:=
range
curFTXOTxs
{
if
!
ftxo
.
IsExpire
(
blockheight
,
blocktime
)
{
continue
}
store
.
moveFTXO2UTXO
(
keys
[
i
],
dbbatch
)
bizlog
.
Debug
(
"moveFTXO2UTXOWhenFTXOExpire"
,
"moveFTXO2UTXO key"
,
string
(
keys
[
i
]),
"ftxo.IsExpire"
,
ftxo
.
IsExpire
(
blockheight
,
blocktime
))
}
dbbatch
.
Write
()
}
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