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
a17b5dd1
Commit
a17b5dd1
authored
May 15, 2017
by
Pieterjan Vanhoof
Committed by
GitHub
May 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #53 from bokobza/feature/build-transaction
Fixed inserting the tx twice
parents
36cf64fb
821cc8c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
WalletManager.cs
Breeze/src/Breeze.Wallet/WalletManager.cs
+27
-13
No files found.
Breeze/src/Breeze.Wallet/WalletManager.cs
View file @
a17b5dd1
...
...
@@ -491,7 +491,12 @@ namespace Breeze.Wallet
/// <param name="spendingTransactionIndex">The index of the output in the transaction being referenced, if this is a spending transaction.</param>
private
void
AddTransactionToWallet
(
uint256
transactionHash
,
uint
time
,
int
?
index
,
Money
amount
,
Script
script
,
int
?
blockHeight
=
null
,
uint
?
blockTime
=
null
,
uint256
spendingTransactionId
=
null
,
int
?
spendingTransactionIndex
=
null
)
{
// get the collection of transactions to add to.
this
.
keysLookup
.
TryGetValue
(
script
,
out
ICollection
<
TransactionData
>
trans
);
// if it's the first time we see this transaction
if
(
trans
!=
null
&&
trans
.
All
(
t
=>
t
.
Id
!=
transactionHash
))
{
trans
.
Add
(
new
TransactionData
{
Amount
=
amount
,
...
...
@@ -511,6 +516,15 @@ namespace Breeze.Wallet
transactions
.
Single
(
t
=>
t
.
Index
==
spendingTransactionIndex
).
SpentInTransaction
=
transactionHash
;
}
}
}
else
if
(
trans
.
Any
(
t
=>
t
.
Id
==
transactionHash
&&
!
t
.
Confirmed
))
// if this is an unconfirmed transaction now received in a block
{
var
foundTransaction
=
trans
.
Single
(
t
=>
t
.
Id
==
transactionHash
&&
!
t
.
Confirmed
);
if
(
blockHeight
!=
null
)
{
foundTransaction
.
Confirmed
=
true
;
}
}
// notify a transaction has been found
this
.
TransactionFound
?.
Invoke
(
this
,
new
TransactionFoundEventArgs
(
script
,
transactionHash
));
...
...
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