Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
张蕾
Geth-Modification
Commits
2c90c0df
Commit
2c90c0df
authored
Jan 03, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated fee
parent
2d3c3674
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
transaction.go
transaction.go
+10
-7
No files found.
transaction.go
View file @
2c90c0df
...
...
@@ -34,9 +34,10 @@ var Period3Reward *big.Int = new(big.Int)
var
Period4Reward
*
big
.
Int
=
new
(
big
.
Int
)
type
Transaction
struct
{
nonce
string
sender
string
recipient
string
value
uint
32
value
uint
64
fee
uint32
data
[]
string
memory
[]
int
...
...
@@ -47,8 +48,9 @@ type Transaction struct {
addr
string
}
func
NewTransaction
(
to
string
,
value
uint
32
,
data
[]
string
)
*
Transaction
{
func
NewTransaction
(
to
string
,
value
uint
64
,
data
[]
string
)
*
Transaction
{
tx
:=
Transaction
{
sender
:
"1234567890"
,
recipient
:
to
,
value
:
value
}
tx
.
nonce
=
"0"
tx
.
fee
=
0
//uint32((ContractFee + MemoryFee * float32(len(tx.data))) * 1e8)
tx
.
lastTx
=
"0"
...
...
@@ -102,16 +104,16 @@ func (tx *Transaction) UnmarshalRlp(data []byte) {
// If only I knew of a better way.
if
value
,
ok
:=
slice
[
3
]
.
(
uint8
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
if
value
,
ok
:=
slice
[
3
]
.
(
uint16
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
if
value
,
ok
:=
slice
[
3
]
.
(
uint32
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
if
value
,
ok
:=
slice
[
3
]
.
(
uint64
);
ok
{
tx
.
value
=
uint
32
(
value
)
tx
.
value
=
uint
64
(
value
)
}
if
fee
,
ok
:=
slice
[
4
]
.
(
uint8
);
ok
{
tx
.
fee
=
uint32
(
fee
)
...
...
@@ -146,7 +148,8 @@ func InitFees() {
b80
:=
new
(
big
.
Int
)
b80
.
Exp
(
big
.
NewInt
(
2
),
big
.
NewInt
(
80
),
big
.
NewInt
(
0
))
StepFee
.
Div
(
b60
,
big
.
NewInt
(
64
))
StepFee
.
Exp
(
big
.
NewInt
(
10
),
big
.
NewInt
(
16
),
big
.
NewInt
(
0
))
//StepFee.Div(b60, big.NewInt(64))
//fmt.Println("StepFee:", StepFee)
TxFee
.
Exp
(
big
.
NewInt
(
2
),
big
.
NewInt
(
64
),
big
.
NewInt
(
0
))
...
...
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