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
5735e1f7
Commit
5735e1f7
authored
May 15, 2017
by
Jeremy Bokobza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the right transaction to use is returned when building transactions
parent
e77df3ad
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 @
5735e1f7
...
@@ -323,14 +323,17 @@ namespace Breeze.Wallet
...
@@ -323,14 +323,17 @@ namespace Breeze.Wallet
}
}
/// <summary>
/// <summary>
/// Finds the address
in which the
transaction is contained.
/// Finds the address
es in which a
transaction is contained.
/// </summary>
/// </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>
/// <returns></returns>
public
HdAddress
FindAddressForTransaction
(
uint256
transactionId
)
public
IEnumerable
<
HdAddress
>
FindAddressesForTransaction
(
Func
<
TransactionData
,
bool
>
predicate
)
{
{
var
addresses
=
this
.
ExternalAddresses
.
Concat
(
this
.
InternalAddresses
);
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
...
@@ -412,7 +415,7 @@ namespace Breeze.Wallet
/// <summary>
/// <summary>
/// The height of the block including this transaction.
/// The height of the block including this transaction.
/// </summary>
/// </summary>
[
JsonProperty
(
PropertyName
=
"blockHeight"
)]
[
JsonProperty
(
PropertyName
=
"blockHeight"
,
NullValueHandling
=
NullValueHandling
.
Ignore
)]
public
int
?
BlockHeight
{
get
;
set
;
}
public
int
?
BlockHeight
{
get
;
set
;
}
/// <summary>
/// <summary>
...
...
Breeze/src/Breeze.Wallet/WalletManager.cs
View file @
5735e1f7
...
@@ -359,7 +359,7 @@ namespace Breeze.Wallet
...
@@ -359,7 +359,7 @@ namespace Breeze.Wallet
var
coins
=
new
List
<
Coin
>();
var
coins
=
new
List
<
Coin
>();
foreach
(
var
transactionToUse
in
calculationResult
.
transactionsToUse
)
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
));
ExtKey
addressExtKey
=
seedExtKey
.
Derive
(
new
KeyPath
(
address
.
HdPath
));
BitcoinExtKey
addressPrivateKey
=
addressExtKey
.
GetWif
(
wallet
.
Network
);
BitcoinExtKey
addressPrivateKey
=
addressExtKey
.
GetWif
(
wallet
.
Network
);
signingKeys
.
Add
(
addressPrivateKey
);
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