Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Commit

Permalink
Update: Correct coinbase catch for TX scanning v3
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoCoderz committed Jul 10, 2021
1 parent 9fc4c19 commit 44671cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DigitalNote.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = DigitalNote-qt
VERSION = 1.0.4.0
VERSION = 1.0.4.1
INCLUDEPATH += src src/json src/qt src/qt/plugins/mrichtexteditor
QT += core gui widgets network printsupport
DEFINES += ENABLE_WALLET
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 1

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
9 changes: 7 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ bool fImporting = false;
bool fReindex = false;
bool fAddrIndex = false;
bool fHaveGUI = false;
bool AcceptBlock_Tx_Scan = false;

struct COrphanBlock {
uint256 hashBlock;
Expand Down Expand Up @@ -1673,8 +1674,8 @@ const CTxOut& CTransaction::GetOutputFor(const CTxIn& input, const MapPrevTx& in
const CTransaction& txPrev = (mi->second).second;
// Don't allow oversized outputs
if (input.prevout.n >= txPrev.vout.size()) {
// Skip if input is coinstake tx!
if(!IsCoinStake()) {
// Skip if queried by AcceptBlock()
if (!AcceptBlock_Tx_Scan) {
throw std::runtime_error("CTransaction::GetOutputFor() : prevout.n out of range");
}
}
Expand All @@ -1692,6 +1693,9 @@ int64_t CTransaction::GetValueMapIn(const MapPrevTx& inputs) const
{
nResult += GetOutputFor(vin[i], inputs).nValue;
}
if (AcceptBlock_Tx_Scan) {
AcceptBlock_Tx_Scan = false;
}
return nResult;

}
Expand Down Expand Up @@ -2961,6 +2965,7 @@ bool CBlock::AcceptBlock()
// Log inputs/output values
MapPrevTx mapInputs;
tx.GetMapTxInputs(mapInputs);
AcceptBlock_Tx_Scan = true;
// Log inputs/output values
if(tx_inputs_values + tx.GetValueMapIn(mapInputs) >= 0)
{
Expand Down

0 comments on commit 44671cf

Please sign in to comment.