succesfully found the contract address

"
This commit is contained in:
greg 2018-04-15 15:41:16 -04:00
parent 358f6a8aaf
commit 156348b459
7 changed files with 16 additions and 11 deletions

View file

@ -56,7 +56,6 @@ import (
"github.com/ethereum/go-ethereum/p2p/netutil"
"github.com/ethereum/go-ethereum/params"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
"gopkg.in/urfave/cli.v1"
)
var (

View file

@ -137,7 +137,6 @@ type BlockChain struct {
// available in the database. It initialises the default Ethereum Validator and
// Processor.
func NewBlockChain(db ethdb.Database, blockExplorerDb ethdb.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig, engine consensus.Engine, vmConfig vm.Config) (*BlockChain, error) {
fmt.Printf("+++++++++++++++++core/blockchain.GO+++++++++++++++++++++++++NewBlockChain()")
if cacheConfig == nil {
cacheConfig = &CacheConfig{
TrieNodeLimit: 256 * 1024 * 1024,
@ -877,7 +876,6 @@ func (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) (e
// WriteBlockWithState writes the block and all associated state to the database.
func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.Receipt, state *state.StateDB) (status WriteStatus, err error) {
fmt.Println("+++++++++++++++++++Blockchain.go+++++++++++++++++writeBlockWithState()")
bc.wg.Add(1)
defer bc.wg.Done()
@ -903,7 +901,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
if err := WriteBlock(batch, block); err != nil {
return NonStatTy, err
}
// @NOTE:SHYFT - Write block data for block explorer
explorerBatch := bc.blockExplorerDb.NewBatch()
if err := shyftdb.WriteBlock(explorerBatch, block); err != nil {
return NonStatTy, err

View file

@ -21,8 +21,8 @@ import (
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"math/big"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
@ -447,10 +447,14 @@ func WriteTd(db ethdb.Putter, hash common.Hash, number uint64, td *big.Int) erro
// WriteBlock serializes a block into the database, header and body separately.
func WriteBlock(db ethdb.Putter, block *types.Block) error {
fmt.Println("+++++++++++++++++++++++++++")
fmt.Println(block.Transactions())
fmt.Println("+++++++++++++++++++++++++++")
// Store the body first to retain database consistency
fmt.Println("\t\t ~~~~~BLOCK~~~~~")
if block.Transactions().Len() > 0 {
for _, tx := range block.Transactions() {
fmt.Println(tx.To().Hex())
fmt.Println(block.Transactions()[0].To().Hex())
}
}
if err := WriteBody(db, block.Hash(), block.NumberU64(), block.Body()); err != nil {
return err
}
@ -466,6 +470,7 @@ func WriteBlock(db ethdb.Putter, block *types.Block) error {
// as a single receipt slice. This is used during chain reorganisations for
// rescheduling dropped transactions.
func WriteBlockReceipts(db ethdb.Putter, hash common.Hash, number uint64, receipts types.Receipts) error {
// Convert the receipts into their storage form and serialize them
storageReceipts := make([]*types.ReceiptForStorage, len(receipts))
for i, receipt := range receipts {
@ -477,6 +482,7 @@ func WriteBlockReceipts(db ethdb.Putter, hash common.Hash, number uint64, receip
}
// Store the flattened receipt slice
key := append(append(blockReceiptsPrefix, encodeBlockNumber(number)...), hash.Bytes()...)
if err := db.Put(key, bytes); err != nil {
log.Crit("Failed to store block receipts", "err", err)
}

View file

@ -94,6 +94,8 @@ func newTransaction(nonce uint64, to *common.Address, amount *big.Int, gasLimit
if len(data) > 0 {
data = common.CopyBytes(data)
}
fmt.Println("DASas")
fmt.Println(to)
d := txdata{
AccountNonce: nonce,
Recipient: to,

View file

@ -72,7 +72,6 @@ func (set *unconfirmedBlocks) Insert(index uint64, hash common.Hash) {
// Set as the initial ring or append to the end
set.lock.Lock()
defer set.lock.Unlock()
if set.blocks == nil {
set.blocks = item
} else {

View file

@ -642,6 +642,7 @@ func (n *Node) EventMux() *event.TypeMux {
// previous can be found) from within the node's instance directory. If the node is
// ephemeral, a memory database is returned.
func (n *Node) OpenDatabase(name string, cache, handles int) (ethdb.Database, error) {
fmt.Println("DSAhhysagdhkajsndjgasuygdvkhasbdjhs")
if n.config.DataDir == "" {
return ethdb.NewMemDatabase()
}

View file

@ -2,8 +2,8 @@ var firstAccount = web3.eth.accounts[0]
var secondAccount = web3.eth.accounts[1]
var thirdAccount = web3.eth.accounts[2]
for (var i = 0; i < 50; i++) {
console.log('\t\t' +i+ ' - iterations')
for (var i = 0; i < 3; i++) {
console.log('\t\t' + (i + 1) + ' - Transactions')
web3.eth.sendTransaction({
from: web3.eth.accounts[0],
to: web3.eth.accounts[1],