Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
destream-blockchain
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
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
DeStream-public
destream-blockchain
Commits
2ae2f379
Commit
2ae2f379
authored
Nov 07, 2018
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify fee calculation precision
parent
12cc234a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
DeStreamBlockFeeRule.cs
...tures.Consensus/Rules/CommonRules/DeStreamBlockFeeRule.cs
+2
-2
No files found.
Sources/Stratis.Bitcoin.Features.Consensus/Rules/CommonRules/DeStreamBlockFeeRule.cs
View file @
2ae2f379
...
@@ -35,7 +35,7 @@ namespace Stratis.Bitcoin.Features.Consensus.Rules.CommonRules
...
@@ -35,7 +35,7 @@ namespace Stratis.Bitcoin.Features.Consensus.Rules.CommonRules
$"Rule context must be
{
nameof
(
DeStreamPowRuleContext
)}
or
{
nameof
(
DeStreamRuleContext
)}
"
);
$"Rule context must be
{
nameof
(
DeStreamPowRuleContext
)}
or
{
nameof
(
DeStreamRuleContext
)}
"
);
}
}
if
(
Math
.
Abs
(
actualFee
-
expectedFee
)
>
Money
.
CENT
)
if
(
Math
.
Abs
(
actualFee
-
expectedFee
)
>
1
)
ConsensusErrors
.
BadTransactionFeeOutOfRange
.
Throw
();
ConsensusErrors
.
BadTransactionFeeOutOfRange
.
Throw
();
return
Task
.
CompletedTask
;
return
Task
.
CompletedTask
;
...
@@ -70,7 +70,7 @@ namespace Stratis.Bitcoin.Features.Consensus.Rules.CommonRules
...
@@ -70,7 +70,7 @@ namespace Stratis.Bitcoin.Features.Consensus.Rules.CommonRules
double
feeInTransaction
=
transaction
.
Outputs
double
feeInTransaction
=
transaction
.
Outputs
.
Where
(
p
=>
!
changeScriptPubKeys
.
Contains
(
p
.
ScriptPubKey
))
.
Where
(
p
=>
!
changeScriptPubKeys
.
Contains
(
p
.
ScriptPubKey
))
.
Sum
(
p
=>
p
.
Value
)
*
this
.
Parent
.
Network
.
FeeRate
;
.
Sum
(
p
=>
p
.
Value
)
*
this
.
Parent
.
Network
.
FeeRate
;
if
(
Math
.
Abs
(
totalIn
.
Satoshi
-
transaction
.
TotalOut
.
Satoshi
-
feeInTransaction
)
>
Money
.
CENT
)
if
(
Math
.
Abs
(
totalIn
.
Satoshi
-
transaction
.
TotalOut
.
Satoshi
-
feeInTransaction
)
>
1
)
ConsensusErrors
.
BadTransactionFeeOutOfRange
.
Throw
();
ConsensusErrors
.
BadTransactionFeeOutOfRange
.
Throw
();
return
(
long
)
(
feeInTransaction
*
this
.
Parent
.
Network
.
DeStreamFeePart
);
return
(
long
)
(
feeInTransaction
*
this
.
Parent
.
Network
.
DeStreamFeePart
);
...
...
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