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
fbf32102
Commit
fbf32102
authored
Jan 14, 2019
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge UnspentOutputSet
parent
42209934
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
UnspentOutputSet.cs
...es/Stratis.Bitcoin.Features.Consensus/UnspentOutputSet.cs
+4
-4
No files found.
Sources/Stratis.Bitcoin.Features.Consensus/UnspentOutputSet.cs
View file @
fbf32102
...
@@ -8,7 +8,7 @@ namespace Stratis.Bitcoin.Features.Consensus
...
@@ -8,7 +8,7 @@ namespace Stratis.Bitcoin.Features.Consensus
{
{
public
class
UnspentOutputSet
public
class
UnspentOutputSet
{
{
pr
ivate
Dictionary
<
uint256
,
UnspentOutputs
>
unspents
;
pr
otected
Dictionary
<
uint256
,
UnspentOutputs
>
unspents
;
public
TxOut
GetOutputFor
(
TxIn
txIn
)
public
TxOut
GetOutputFor
(
TxIn
txIn
)
{
{
...
@@ -19,7 +19,7 @@ namespace Stratis.Bitcoin.Features.Consensus
...
@@ -19,7 +19,7 @@ namespace Stratis.Bitcoin.Features.Consensus
return
unspent
.
TryGetOutput
(
txIn
.
PrevOut
.
N
);
return
unspent
.
TryGetOutput
(
txIn
.
PrevOut
.
N
);
}
}
public
bool
HaveInputs
(
Transaction
tx
)
public
virtual
bool
HaveInputs
(
Transaction
tx
)
{
{
return
tx
.
Inputs
.
All
(
txin
=>
this
.
GetOutputFor
(
txin
)
!=
null
);
return
tx
.
Inputs
.
All
(
txin
=>
this
.
GetOutputFor
(
txin
)
!=
null
);
}
}
...
@@ -29,7 +29,7 @@ namespace Stratis.Bitcoin.Features.Consensus
...
@@ -29,7 +29,7 @@ namespace Stratis.Bitcoin.Features.Consensus
return
this
.
unspents
.
TryGet
(
uint256
);
return
this
.
unspents
.
TryGet
(
uint256
);
}
}
public
Money
GetValueIn
(
Transaction
tx
)
public
virtual
Money
GetValueIn
(
Transaction
tx
)
{
{
return
tx
.
Inputs
.
Select
(
txin
=>
this
.
GetOutputFor
(
txin
).
Value
).
Sum
();
return
tx
.
Inputs
.
Select
(
txin
=>
this
.
GetOutputFor
(
txin
).
Value
).
Sum
();
}
}
...
@@ -39,7 +39,7 @@ namespace Stratis.Bitcoin.Features.Consensus
...
@@ -39,7 +39,7 @@ namespace Stratis.Bitcoin.Features.Consensus
/// </summary>
/// </summary>
/// <param name="transaction">Transaction which inputs and outputs are used for updating unspent coins list.</param>
/// <param name="transaction">Transaction which inputs and outputs are used for updating unspent coins list.</param>
/// <param name="height">Height of a block that contains target transaction.</param>
/// <param name="height">Height of a block that contains target transaction.</param>
public
void
Update
(
Transaction
transaction
,
int
height
)
public
v
irtual
v
oid
Update
(
Transaction
transaction
,
int
height
)
{
{
if
(!
transaction
.
IsCoinBase
)
if
(!
transaction
.
IsCoinBase
)
{
{
...
...
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