Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
Breeze
Commits
93983ede
Commit
93983ede
authored
May 15, 2017
by
Jeremy Bokobza
Committed by
GitHub
May 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #57 from bokobza/master
Make sure the right transaction to use is returned when building tran…
parents
f924c46f
5735e1f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
Wallet.cs
Breeze/src/Breeze.Wallet/Wallet.cs
+8
-5
WalletManager.cs
Breeze/src/Breeze.Wallet/WalletManager.cs
+1
-1
No files found.
Breeze/src/Breeze.Wallet/Wallet.cs
View file @
93983ede
...
...
@@ -323,14 +323,17 @@ namespace Breeze.Wallet
}
/// <summary>
/// Finds the address
in which the
transaction is contained.
/// Finds the address
es in which a
transaction is contained.
/// </summary>
/// <param name="transactionId">The transaction identifier.</param>
/// <remarks>
/// Returns a collection because a transaction can be contained in a change address as well as in a receive address (as a spend).
/// </remarks>
/// <param name="predicate">A predicate by which to filter the transactions.</param>
/// <returns></returns>
public
HdAddress
FindAddressForTransaction
(
uint256
transactionId
)
public
IEnumerable
<
HdAddress
>
FindAddressesForTransaction
(
Func
<
TransactionData
,
bool
>
predicate
)
{
var
addresses
=
this
.
ExternalAddresses
.
Concat
(
this
.
InternalAddresses
);
return
addresses
.
SingleOrDefault
(
a
=>
a
.
Transactions
.
Any
(
t
=>
t
.
Id
==
transactionId
));
return
addresses
.
Where
(
a
=>
a
.
Transactions
.
Any
(
predicate
));
}
}
...
...
@@ -412,7 +415,7 @@ namespace Breeze.Wallet
/// <summary>
/// The height of the block including this transaction.
/// </summary>
[
JsonProperty
(
PropertyName
=
"blockHeight"
)]
[
JsonProperty
(
PropertyName
=
"blockHeight"
,
NullValueHandling
=
NullValueHandling
.
Ignore
)]
public
int
?
BlockHeight
{
get
;
set
;
}
/// <summary>
...
...
Breeze/src/Breeze.Wallet/WalletManager.cs
View file @
93983ede
...
...
@@ -359,7 +359,7 @@ namespace Breeze.Wallet
var
coins
=
new
List
<
Coin
>();
foreach
(
var
transactionToUse
in
calculationResult
.
transactionsToUse
)
{
var
address
=
account
.
FindAddress
ForTransaction
(
transactionToUse
.
Id
);
var
address
=
account
.
FindAddress
esForTransaction
(
t
=>
t
.
Id
==
transactionToUse
.
Id
&&
t
.
Amount
>
0
).
Single
(
);
ExtKey
addressExtKey
=
seedExtKey
.
Derive
(
new
KeyPath
(
address
.
HdPath
));
BitcoinExtKey
addressPrivateKey
=
addressExtKey
.
GetWif
(
wallet
.
Network
);
signingKeys
.
Add
(
addressPrivateKey
);
...
...
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