-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate the pending account structure from other pending outputs (li…
…ke founder spend)
- Loading branch information
1 parent
81af264
commit 3cde90e
Showing
8 changed files
with
65 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
using Blockcore.Networks; | ||
|
||
namespace Angor.Shared.Models; | ||
|
||
public class UnconfirmedInfo | ||
{ | ||
public List<UtxoData> PendingReceive { get; set; } = new(); | ||
public List<UtxoData> PendingSpent { get; set; } = new(); | ||
public List<UtxoData> AccountPendingReceive { get; set; } = new(); | ||
public List<UtxoData> AccountPendingSpent { get; set; } = new(); | ||
|
||
public List<Outpoint> PendingSpent { get; set; } = new(); | ||
|
||
public void RemoveInputsFromPending(string trxid) | ||
{ | ||
foreach (var input in PendingSpent.ToList()) | ||
{ | ||
if (input.transactionId == trxid) | ||
{ | ||
PendingSpent.Remove(input); | ||
} | ||
} | ||
} | ||
|
||
public void AddInputsAsPending(Blockcore.Consensus.TransactionInfo.Transaction transaction) | ||
{ | ||
var inputs = transaction.Inputs.Select(_ => _.PrevOut).ToList(); | ||
|
||
foreach (var outPoint in inputs) | ||
{ | ||
if (PendingSpent.All(input => input.ToString() != outPoint.ToString())) | ||
{ | ||
PendingSpent.Add(Outpoint.FromOutPoint(outPoint)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters