Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2017-2020 The Bitcoin developers | // Copyright (c) 2017-2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <wallet/walletdb.h> | #include <wallet/walletdb.h> | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <consensus/tx_check.h> | |||||
#include <consensus/validation.h> | |||||
#include <fs.h> | #include <fs.h> | ||||
#include <key_io.h> | #include <key_io.h> | ||||
#include <protocol.h> | #include <protocol.h> | ||||
#include <serialize.h> | #include <serialize.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/time.h> | #include <util/time.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | try { | ||||
->mapAddressBook[DecodeDestination( | ->mapAddressBook[DecodeDestination( | ||||
strAddress, pwallet->chainParams)] | strAddress, pwallet->chainParams)] | ||||
.purpose; | .purpose; | ||||
} else if (strType == DBKeys::TX) { | } else if (strType == DBKeys::TX) { | ||||
TxId txid; | TxId txid; | ||||
ssKey >> txid; | ssKey >> txid; | ||||
CWalletTx wtx(nullptr /* pwallet */, MakeTransactionRef()); | CWalletTx wtx(nullptr /* pwallet */, MakeTransactionRef()); | ||||
ssValue >> wtx; | ssValue >> wtx; | ||||
TxValidationState state; | if (wtx.GetId() != txid) { | ||||
bool isValid = wtx.IsCoinBase() | |||||
? CheckCoinbase(*wtx.tx, state) | |||||
: CheckRegularTransaction(*wtx.tx, state); | |||||
if (!isValid || wtx.GetId() != txid) { | |||||
return false; | return false; | ||||
} | } | ||||
// Undo serialize changes in 31600 | // Undo serialize changes in 31600 | ||||
if (31404 <= wtx.fTimeReceivedIsTxTime && | if (31404 <= wtx.fTimeReceivedIsTxTime && | ||||
wtx.fTimeReceivedIsTxTime <= 31703) { | wtx.fTimeReceivedIsTxTime <= 31703) { | ||||
if (!ssValue.empty()) { | if (!ssValue.empty()) { | ||||
char fTmp; | char fTmp; | ||||
▲ Show 20 Lines • Show All 590 Lines • Show Last 20 Lines |