diff options
| author | Pieter Wuille <[email protected]> | 2016-07-18 20:57:20 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-07-19 12:31:49 +0200 |
| commit | ab942c15bd3854650afa810d7c22d7fd30d346c1 (patch) | |
| tree | b1b4aeac333ab2f3b3b21a31d614e1674e0774f3 /src/policy/policy.cpp | |
| parent | Merge #8367: [Wallet] Ensure <0.13 clients can't open HD wallets (diff) | |
| download | discoin-ab942c15bd3854650afa810d7c22d7fd30d346c1.tar.xz discoin-ab942c15bd3854650afa810d7c22d7fd30d346c1.zip | |
Treat high-sigop transactions as larger rather than rejecting them
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); } |