Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
[3.0.8.0] Added minimum balance check (#4226)
Browse files Browse the repository at this point in the history
* Added ledger support

* Fixed block explorer

* Added CL args

* Added a flag to ignore balance check

* Fixed explorer test

* Minor changes as per feedback

* Minor changes as per feedback

* Added global.json to lock the version

* DOwngraded to 2.1

* Removed unused tests

* Added keypath param for advanced users

* Fixed address scanning

* Fix for index

* Added more logs

* Added more logs

* Added logic to scan change addresses

* Added more logs

* Added ability to output signature

* Added minimum balance check

Co-authored-by: Igor Goldobin <[email protected]>
  • Loading branch information
fenix2222 and fenix2222 authored Apr 8, 2021
1 parent 6098d91 commit 16147ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/AddressOwnershipTool/AddressOwnershipService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class AddressOwnershipService
private const string ownershipFilename = "ownership.csv";
private const decimal splitThreshold = 10_000m * 100_000_000m; // In stratoshi
private const decimal splitCount = 10;
private const decimal minumumBalanceToAcceptInSats = 5460;

private readonly Network network;
private readonly string ownershipFilePath;
Expand Down Expand Up @@ -167,12 +168,18 @@ public void Validate(string sigFileFolder)

decimal balance = stratisApiClient.GetAddressBalance(address);

if (balance <= 0)
if (balance == 0)
{
Console.WriteLine($"Address {address} has a zero balance, skipping it.");

continue;
}
else if (balance < minumumBalanceToAcceptInSats)
{
Console.WriteLine($"Address {address} has a balance of {balance} sats which is below minimum of {minumumBalanceToAcceptInSats}, skipping it.");

continue;
}
else
{
Console.WriteLine($"Address {address} has a balance of {balance}.");
Expand Down

0 comments on commit 16147ca

Please sign in to comment.