Skip to content

Commit 7fc8b68

Browse files
committed
Bug fix
1 parent 0a1891a commit 7fc8b68

25 files changed

Lines changed: 32 additions & 32 deletions
30 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

.vs/BitNav/FileContentIndex/read.lock

Whitespace-only changes.

.vs/BitNav/v17/.suo

512 Bytes
Binary file not shown.

BitNav/Bitcoin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private int GenerateRandomInteger()
7676
}
7777
}
7878

79-
private long ConvertBitcoinToSatoshis(double bitcoinAmount)
79+
public static long ConvertBitcoinToSatoshis(double bitcoinAmount)
8080
{
8181
const long satoshisPerBitcoin = 100_000_000;
8282
return (long)(bitcoinAmount * satoshisPerBitcoin);

BitNav/Transaction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public bool checkTransactionReceived()
7272
Console.WriteLine(txAmounts.GetProperty("addresses").GetString());
7373
if (txAmounts.GetProperty("addresses").GetString() == address)
7474
{
75-
if (checkEqualWithMargin(amount, txAmounts.GetProperty("value").GetInt32(), 0))
75+
if (checkEqualWithMargin(Bitcoin.ConvertBitcoinToSatoshis(amount), txAmounts.GetProperty("value").GetInt32(), 0))
7676
{
7777
transactionHash = tx.GetProperty("tx_hash").GetString();
7878
receivedTime = unixTime;
@@ -144,7 +144,7 @@ public bool checkTransactionConfirmed()
144144
return false;
145145
}
146146

147-
private bool checkEqualWithMargin(int a, int b, int margin)
147+
private bool checkEqualWithMargin(long a, long b, int margin)
148148
{
149149
return a >= b - margin && a <= b + margin;
150150
}

0 commit comments

Comments
 (0)