Changeset View
Changeset View
Standalone View
Standalone View
src/script/script_metrics.h
// Copyright (c) 2020 The Bitcoin developers | // Copyright (c) 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. | ||||
#ifndef BITCOIN_SCRIPT_SCRIPT_METRICS_H | #ifndef BITCOIN_SCRIPT_SCRIPT_METRICS_H | ||||
#define BITCOIN_SCRIPT_SCRIPT_METRICS_H | #define BITCOIN_SCRIPT_SCRIPT_METRICS_H | ||||
/** | /** | ||||
* Struct for holding cumulative results from executing a script or a sequence | * Struct for holding cumulative results from executing a script or a sequence | ||||
* of scripts. | * of scripts. | ||||
*/ | */ | ||||
struct ScriptExecutionMetrics { | struct ScriptExecutionMetrics { | ||||
int nSigChecks = 0; | int nSigChecks = 0; | ||||
ScriptExecutionMetrics() = default; | |||||
ScriptExecutionMetrics(int _nSigChecks) : nSigChecks(_nSigChecks) {} | |||||
bool operator==(const ScriptExecutionMetrics &rhs) { | |||||
return nSigChecks == rhs.nSigChecks; | |||||
} | |||||
}; | }; | ||||
#endif // BITCOIN_SCRIPT_SCRIPT_METRICS_H | #endif // BITCOIN_SCRIPT_SCRIPT_METRICS_H |