les: backported new SendTx cost calculation

This commit is contained in:
Zsolt Felfoldi
2019-04-10 10:44:19 +02:00
parent 14ae1246b7
commit 0de9f32ae8
3 changed files with 42 additions and 8 deletions

View File

@@ -508,8 +508,9 @@ func TestTransactionStatusLes2(t *testing.T) {
test := func(tx *types.Transaction, send bool, expStatus txStatus) {
reqID++
if send {
cost := peer.GetRequestCost(SendTxV2Msg, 1)
sendRequest(peer.app, SendTxV2Msg, reqID, cost, types.Transactions{tx})
enc, _ := rlp.EncodeToBytes(types.Transactions{tx})
cost := peer.GetTxRelayCost(1, len(enc))
sendRequest(peer.app, SendTxV2Msg, reqID, cost, rlp.RawValue(enc))
} else {
cost := peer.GetRequestCost(GetTxStatusMsg, 1)
sendRequest(peer.app, GetTxStatusMsg, reqID, cost, []common.Hash{tx.Hash()})