From 9c1e7af9c799bcd8815a1bf3dbe5bbc10005b121 Mon Sep 17 00:00:00 2001
From: pbattu123
Date: Thu, 21 Nov 2019 10:40:39 -0400
Subject: [PATCH] issue with withdrawl
---
libraries/chain/vesting_balance_evaluator.cpp | 4 ++--
libraries/wallet/wallet.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libraries/chain/vesting_balance_evaluator.cpp b/libraries/chain/vesting_balance_evaluator.cpp
index 28282b87..ec974600 100644
--- a/libraries/chain/vesting_balance_evaluator.cpp
+++ b/libraries/chain/vesting_balance_evaluator.cpp
@@ -123,7 +123,7 @@ operation_result vesting_balance_withdraw_evaluator::start_evaluate( transaction
const time_point_sec now = d.head_block_time();
- if(now >= (fc::time_point_sec(1570114100)) )
+ if(now >= HARDFORK_GPOS_TIME )
{
if(oper.fee.amount == 0)
{
@@ -145,7 +145,7 @@ void_result vesting_balance_withdraw_evaluator::do_evaluate( const vesting_balan
const vesting_balance_object& vbo = op.vesting_balance( d );
FC_ASSERT( op.owner == vbo.owner, "", ("op.owner", op.owner)("vbo.owner", vbo.owner) );
- FC_ASSERT( vbo.is_withdraw_allowed( now, op.amount ), "${balance_type} Vested Balance cannot be withdrawn during the locking period",
+ FC_ASSERT( vbo.is_withdraw_allowed( now, op.amount ), "Account has either insufficient ${balance_type} Vested Balance or lock-in period is not matured",
("balance_type", get_vesting_balance_type(vbo.balance_type))("now", now)("op", op)("vbo", vbo) );
assert( op.amount <= vbo.balance ); // is_withdraw_allowed should fail before this check is reached
diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp
index f1b6576e..ac0a7523 100644
--- a/libraries/wallet/wallet.cpp
+++ b/libraries/wallet/wallet.cpp
@@ -2138,7 +2138,7 @@ public:
vesting_balance_withdraw_op.vesting_balance = *vest_id;
vesting_balance_withdraw_op.owner = vbo.owner;
- if(withdraw_amount.amount >= vbo.balance.amount)
+ if(withdraw_amount.amount > vbo.balance.amount)
{
vesting_balance_withdraw_op.amount = vbo.balance.amount;
withdraw_amount.amount -= vbo.balance.amount;