OSDN Git Service

Peer add announces new block message num limit
[bytom/vapor.git] / blockchain / txbuilder / builder.go
index 52a8b39..2c357ad 100644 (file)
@@ -4,6 +4,7 @@ import (
        "math"
        "time"
 
+       "github.com/vapor/common/arithmetic"
        "github.com/vapor/errors"
        "github.com/vapor/protocol/bc/types"
 )
@@ -131,7 +132,10 @@ func (b *TemplateBuilder) Build() (*Template, *types.TxData, error) {
                tx.Inputs = append(tx.Inputs, in)
        }
 
+       var err error
        tpl.Transaction = types.NewTx(*tx)
-       tpl.Fee = CalculateTxFee(tpl.Transaction)
+       if tpl.Fee, err = arithmetic.CalculateTxFee(tpl.Transaction); err != nil {
+               return nil, nil, err
+       }
        return tpl, tx, nil
 }