Skip to content

Commit

Permalink
Fixed invalid initialization of TPoSContract
Browse files Browse the repository at this point in the history
  • Loading branch information
durkmurder committed Sep 28, 2020
1 parent 77e840c commit c9e0922
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 23)
define(_CLIENT_VERSION_REVISION, 24)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2020)
Expand Down
6 changes: 2 additions & 4 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,8 @@ bool CWallet::AddToWalletIfTPoSContract(const CTransactionRef &tx)
{
AssertLockHeld(cs_wallet);

if(TPoSUtils::IsTPoSContract(tx)) {
TPoSContract contract = TPoSContract::FromTPoSContractTx(tx);
if(contract.IsValid()) {
// TODO: FIND CORRECT CONDITIONS TO erase contract
// if(!mempool.exists(tx.GetHash()))
// {
Expand All @@ -1519,16 +1520,13 @@ bool CWallet::AddToWalletIfTPoSContract(const CTransactionRef &tx)
bool isOwner = TPoSUtils::IsTPoSOwnerContract(this, tx);

if(isMerchant || isOwner) {
TPoSContract contract;
std::string strError;

CWalletTx wtx(this, tx);
if(LoadTPoSContract(wtx))
{
WalletBatch walletDb(*database);
walletDb.WriteTPoSContractTx(wtx.GetHash(), wtx);


if(isMerchant && !isOwner) {
AddWatchOnly(contract.scriptTPoSAddress);
}
Expand Down

0 comments on commit c9e0922

Please sign in to comment.