Merge pull request #45 from dinhln89/master

Hot fixed for bug can't deploy smart contract to master node.
This commit is contained in:
Tuna 2018-06-19 15:01:19 +07:00 committed by GitHub
commit 6a3b1a808e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -586,7 +586,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
if pool.currentState.GetBalance(from).Cmp(tx.Cost()) < 0 {
return ErrInsufficientFunds
}
if tx.To().String() != common.BlockSigners {
if tx.To() != nil && tx.To().String() != common.BlockSigners {
intrGas, err := IntrinsicGas(tx.Data(), tx.To() == nil, pool.homestead)
if err != nil {
return err

View file

@ -217,7 +217,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
if number > 0 && prevCheckpoint > 0 {
// Not reward for singer of genesis block and only calculate reward at checkpoint block.
startBlockNumber := number - (rCheckpoint * 2) + 1
endBlockNumber := startBlockNumber + rCheckpoint - 2
endBlockNumber := startBlockNumber + rCheckpoint - 1
signers := make(map[common.Address]*rewardLog)
validators := make(map[common.Address]*rewardLog)
totalSigner := uint64(0)