diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-07-26 11:10:31 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-07-26 11:27:30 +0200 |
| commit | 618c9dd8c651f15ea37a09d3ee4fa4426c75ac02 (patch) | |
| tree | a34413030e80c00d49988a2354a4a2f8564e0c15 /src/policy/policy.cpp | |
| parent | Merge #8362: Scale legacy sigop count in CreateNewBlock (diff) | |
| parent | Treat high-sigop transactions as larger rather than rejecting them (diff) | |
| download | archived-discoin-618c9dd8c651f15ea37a09d3ee4fa4426c75ac02.tar.xz archived-discoin-618c9dd8c651f15ea37a09d3ee4fa4426c75ac02.zip | |
Merge #8365: Treat high-sigop transactions as larger rather than rejecting them
ab942c1 Treat high-sigop transactions as larger rather than rejecting them (Pieter Wuille)
Diffstat (limited to 'src/policy/policy.cpp')
| -rw-r--r-- | src/policy/policy.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 8617db00c..0cd3ac711 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -151,12 +151,14 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) return true; } -int64_t GetVirtualTransactionSize(int64_t nWeight) +unsigned int nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP; + +int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost) { - return (nWeight + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR; + return (std::max(nWeight, nSigOpCost * nBytesPerSigOp) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR; } -int64_t GetVirtualTransactionSize(const CTransaction& tx) +int64_t GetVirtualTransactionSize(const CTransaction& tx, int64_t nSigOpCost) { - return GetVirtualTransactionSize(GetTransactionWeight(tx)); + return GetVirtualTransactionSize(GetTransactionWeight(tx), nSigOpCost); } |