mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
fixed issues as per merge comments
This commit is contained in:
parent
2e39356a71
commit
7f70a3e769
1 changed files with 6 additions and 4 deletions
|
|
@ -142,7 +142,7 @@ func WriteTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.Ha
|
||||||
gas := txData.Gas
|
gas := txData.Gas
|
||||||
data := txData.Data
|
data := txData.Data
|
||||||
to := txData.To
|
to := txData.To
|
||||||
if to == nil{
|
if (to == nil){
|
||||||
var retNonce string
|
var retNonce string
|
||||||
sqlStatement := `INSERT INTO txs(txhash, from_addr, blockhash, amount, gasprice, gas, nonce, data) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8)) RETURNING nonce`
|
sqlStatement := `INSERT INTO txs(txhash, from_addr, blockhash, amount, gasprice, gas, nonce, data) VALUES(($1), ($2), ($3), ($4), ($5), ($6), ($7), ($8)) RETURNING nonce`
|
||||||
qerr := sqldb.QueryRow(sqlStatement, txHash, from, blockHasher, amount, gasPrice, gas, nonce, data).Scan(&retNonce)
|
qerr := sqldb.QueryRow(sqlStatement, txHash, from, blockHasher, amount, gasPrice, gas, nonce, data).Scan(&retNonce)
|
||||||
|
|
@ -329,7 +329,6 @@ func WriteBalanceHelper(sqldb *sql.DB, tx *types.Transaction) (SendAndReceive, s
|
||||||
func GetAllBlocks(sqldb *sql.DB) string {
|
func GetAllBlocks(sqldb *sql.DB) string {
|
||||||
var arr blockRes
|
var arr blockRes
|
||||||
var blockArr string
|
var blockArr string
|
||||||
|
|
||||||
rows, err := sqldb.Query(`
|
rows, err := sqldb.Query(`
|
||||||
SELECT
|
SELECT
|
||||||
number,
|
number,
|
||||||
|
|
@ -340,7 +339,6 @@ func GetAllBlocks(sqldb *sql.DB) string {
|
||||||
txcount,
|
txcount,
|
||||||
unclecount,
|
unclecount,
|
||||||
age
|
age
|
||||||
|
|
||||||
FROM blocks`)
|
FROM blocks`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("err")
|
fmt.Println("err")
|
||||||
|
|
@ -400,7 +398,11 @@ func GetBlock(sqldb *sql.DB) string {
|
||||||
var uncleCount string
|
var uncleCount string
|
||||||
var age string
|
var age string
|
||||||
|
|
||||||
row.Scan(&num, &hash, &coinbase, &gasUsed,
|
row.Scan(
|
||||||
|
&num,
|
||||||
|
&hash,
|
||||||
|
&coinbase,
|
||||||
|
&gasUsed,
|
||||||
&gasLimit,
|
&gasLimit,
|
||||||
&txCount,
|
&txCount,
|
||||||
&uncleCount,
|
&uncleCount,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue