Skip to content

Commit

Permalink
Use Network transactions in les protocol (ethereum#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Inphi authored Dec 2, 2022
1 parent d5563a1 commit f2d8e79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion les/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ type GetHelperTrieProofsPacket struct {
// SendTxPacket represents a transaction propagation request
type SendTxPacket struct {
ReqID uint64
Txs []*types.Transaction
Txs []*types.NetworkTransaction
}

// GetTxStatusPacket represents a transaction status query
Expand Down
2 changes: 1 addition & 1 deletion les/server_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func handleSendTx(msg Decoder) (serveRequestFn, uint64, uint64, error) {
if backend.AddTxsSync() {
addFn = backend.TxPool().AddRemotesSync
}
if errs := addFn([]*types.Transaction{tx}); errs[0] != nil {
if errs := addFn([]*types.Transaction{tx.Tx}); errs[0] != nil {
stats[i].Error = errs[0].Error()
continue
}
Expand Down
5 changes: 4 additions & 1 deletion les/txrelay.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ func (ltrx *lesTxRelay) send(txs types.Transactions, count int) {
}

for p, list := range sendTo {
ll := make(types.NetworkTransactions, len(list))
for i := range list {
ll[i] = types.NewNetworkTransaction(list[i])
}
pp := p
ll := list
enc, _ := rlp.EncodeToBytes(ll)

reqID := rand.Uint64()
Expand Down

0 comments on commit f2d8e79

Please sign in to comment.