Skip to content

Commit

Permalink
fix checking avail to withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
elonkusk committed Oct 6, 2022
1 parent cac60fc commit 80197f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

group 'org.unichain'
version '2.0.8'
version '2.0.11'

apply plugin: 'java'
apply plugin: 'com.google.protobuf'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private boolean availableToWithdraw(byte[] ownerAddress, long headBlockTime) {
var futureStore = dbManager.getFutureTransferStore();
FutureTransferCapsule loopDeal;
var lowerTime = -1L;
var atLest = false;

while (true){
//check first
Expand All @@ -103,11 +104,13 @@ private boolean availableToWithdraw(byte[] ownerAddress, long headBlockTime) {
loopDeal = futureStore.get(loopDealBs.toByteArray());
lowerTime = (lowerTime <= 0) ? loopDeal.getExpireTime() : Math.min(lowerTime, loopDeal.getExpireTime());
loopDealBs = loopDeal.getNextTick();
atLest = true;
}

return (headBlockTickDay >= lowerTime);
return atLest && (headBlockTickDay >= lowerTime);
}


/**
* Looping list & delete
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/unichain/program/Version.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.unichain.program;

public class Version {
private static final String version = "2.0.8";
public static final String versionName = "unichain-2.0.8";
public static final String versionCode = "208";
private static final String version = "2.0.11";
public static final String versionName = "unichain-2.0.11";
public static final String versionCode = "211";

public static String getVersion() {
return version;
Expand Down

0 comments on commit 80197f3

Please sign in to comment.