From c9e092257c4afbfda3af034a4a12387eafcc281e Mon Sep 17 00:00:00 2001 From: Yurii Oleksyshyn Date: Mon, 28 Sep 2020 23:04:17 +0300 Subject: [PATCH] Fixed invalid initialization of TPoSContract --- configure.ac | 2 +- src/wallet/wallet.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 2222e3424..bc7912eba 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 198c23120..d87ec4e19 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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())) // { @@ -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); }