Skip to content

Commit c9e0922

Browse files
committed
Fixed invalid initialization of TPoSContract
1 parent 77e840c commit c9e0922

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
22
AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 1)
44
define(_CLIENT_VERSION_MINOR, 0)
5-
define(_CLIENT_VERSION_REVISION, 23)
5+
define(_CLIENT_VERSION_REVISION, 24)
66
define(_CLIENT_VERSION_BUILD, 0)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2020)

src/wallet/wallet.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,8 @@ bool CWallet::AddToWalletIfTPoSContract(const CTransactionRef &tx)
14981498
{
14991499
AssertLockHeld(cs_wallet);
15001500

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

15211522
if(isMerchant || isOwner) {
1522-
TPoSContract contract;
15231523
std::string strError;
1524-
15251524
CWalletTx wtx(this, tx);
15261525
if(LoadTPoSContract(wtx))
15271526
{
15281527
WalletBatch walletDb(*database);
15291528
walletDb.WriteTPoSContractTx(wtx.GetHash(), wtx);
15301529

1531-
15321530
if(isMerchant && !isOwner) {
15331531
AddWatchOnly(contract.scriptTPoSAddress);
15341532
}

0 commit comments

Comments
 (0)