mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1486] Make coinbase mass and size 0 (#970)
This commit is contained in:
parent
aeb4b96560
commit
f62183473c
@ -4,6 +4,7 @@ import (
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/ruleerrors"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/estimatedsize"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/transactionhelper"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/txscript"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@ -34,6 +35,10 @@ func (v *transactionValidator) transactionMassStandalonePart(tx *externalapi.Dom
|
||||
}
|
||||
|
||||
func (v *transactionValidator) transactionMass(tx *externalapi.DomainTransaction) (uint64, error) {
|
||||
if transactionhelper.IsCoinBase(tx) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
standaloneMass := v.transactionMassStandalonePart(tx)
|
||||
sigOpsCount := uint64(0)
|
||||
for _, input := range tx.Inputs {
|
||||
|
@ -2,6 +2,7 @@ package estimatedsize
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/transactionhelper"
|
||||
)
|
||||
|
||||
// TransactionEstimatedSerializedSize is the estimated size of a transaction in some
|
||||
@ -9,6 +10,9 @@ import (
|
||||
// it's only used as the size component in the transaction mass and block size limit
|
||||
// calculation.
|
||||
func TransactionEstimatedSerializedSize(tx *externalapi.DomainTransaction) uint64 {
|
||||
if transactionhelper.IsCoinBase(tx) {
|
||||
return 0
|
||||
}
|
||||
size := uint64(0)
|
||||
|
||||
size += 8 // number of inputs (uint64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user