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
b8b203af
Commit
b8b203af
authored
Jan 14, 2019
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge transaction builder
parent
db1e348c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
DeStreamTransactionBuilder.cs
Sources/NBitcoin/DeStreamTransactionBuilder.cs
+6
-3
TransactionBuilder.cs
Sources/NBitcoin/TransactionBuilder.cs
+5
-5
No files found.
Sources/NBitcoin/DeStreamTransactionBuilder.cs
View file @
b8b203af
...
...
@@ -17,13 +17,16 @@ namespace NBitcoin
this
.
CoinSelector
=
new
DeStreamCoinSelector
(
seed
);
}
protected
override
IEnumerable
<
ICoin
>
BuildTransaction
(
TransactionBuildingContext
ctx
,
BuilderGroup
group
,
protected
override
IEnumerable
<
ICoin
>
BuildTransaction
(
TransactionBuildingContext
ctx
,
BuilderGroup
group
,
IEnumerable
<
Func
<
TransactionBuildingContext
,
IMoney
>>
builders
,
IEnumerable
<
ICoin
>
coins
,
IMoney
zero
)
IEnumerable
<
ICoin
>
coins
,
IMoney
zero
)
{
IEnumerable
<
ICoin
>
result
=
base
.
BuildTransaction
(
ctx
,
group
,
builders
,
coins
,
zero
);
if
(
ctx
.
Transaction
.
Inputs
.
Any
(
p
=>
p
.
PrevOut
.
Hash
==
uint256
.
Zero
))
if
(
ctx
.
Transaction
.
Inputs
.
GetChangePointers
().
Any
(
))
return
result
;
// To secure that fee is charged from spending coins and not from change,
...
...
Sources/NBitcoin/TransactionBuilder.cs
View file @
b8b203af
...
...
@@ -46,7 +46,7 @@ namespace NBitcoin
}
pr
ivate
Random
_Rand
=
new
Random
();
pr
otected
Random
_Rand
=
new
Random
();
public
DefaultCoinSelector
(
int
seed
)
{
this
.
_Rand
=
new
Random
(
seed
);
...
...
@@ -62,7 +62,7 @@ namespace NBitcoin
#
region
ICoinSelector
Members
public
IEnumerable
<
ICoin
>
Select
(
IEnumerable
<
ICoin
>
coins
,
IMoney
target
)
public
virtual
IEnumerable
<
ICoin
>
Select
(
IEnumerable
<
ICoin
>
coins
,
IMoney
target
)
{
IMoney
zero
=
target
.
Sub
(
target
);
...
...
@@ -330,7 +330,7 @@ namespace NBitcoin
}
}
internal
class
TransactionBuildingContext
protected
internal
class
TransactionBuildingContext
{
public
TransactionBuildingContext
(
TransactionBuilder
builder
)
{
...
...
@@ -472,7 +472,7 @@ namespace NBitcoin
}
}
internal
class
BuilderGroup
protected
internal
class
BuilderGroup
{
private
TransactionBuilder
_Parent
;
public
BuilderGroup
(
TransactionBuilder
parent
)
...
...
@@ -1164,7 +1164,7 @@ namespace NBitcoin
return
c
.
Amount
>=
this
.
FilterUneconomicalCoinsRate
.
GetFee
(
vSize
);
}
pr
ivate
IEnumerable
<
ICoin
>
BuildTransaction
(
pr
otected
virtual
IEnumerable
<
ICoin
>
BuildTransaction
(
TransactionBuildingContext
ctx
,
BuilderGroup
group
,
IEnumerable
<
Builder
>
builders
,
...
...
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