Merge pull request #790 from harmony-one/rj_cello

Temporary workaround for explorer address search issue
pull/793/head
Rongjian Lan 6 years ago committed by GitHub
commit e0e4bfaffe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      node/contract.go

@ -167,7 +167,14 @@ func (node *Node) AddFaucetContractToPendingTransactions() {
// CallFaucetContract invokes the faucet contract to give the walletAddress initial money
func (node *Node) CallFaucetContract(address common.Address) common.Hash {
// Temporary code to workaround explorer issue for searching new addresses (https://github.com/harmony-one/harmony/issues/503)
nonce := atomic.AddUint64(&node.ContractDeployerCurrentNonce, 1)
tx, _ := types.SignTx(types.NewTransaction(nonce-1, address, node.Consensus.ShardID, big.NewInt(0), params.TxGasContractCreation*10, nil, nil), types.HomesteadSigner{}, node.ContractDeployerKey)
utils.GetLogInstance().Info("Sending placeholder token to ", "Address", address.Hex())
node.addPendingTransactions(types.Transactions{tx})
// END Temporary code
nonce = atomic.AddUint64(&node.ContractDeployerCurrentNonce, 1)
return node.callGetFreeTokenWithNonce(address, nonce-1)
}

Loading…
Cancel
Save