mirror of
https://github.com/tendermint/tendermint.git
synced 2026-04-19 23:30:38 +00:00
Fixed ProcessProposalSync
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
types "github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/libs/service"
|
||||
tmsync "github.com/tendermint/tendermint/libs/sync"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
var _ Client = (*localClient)(nil)
|
||||
@@ -354,10 +353,7 @@ func (app *localClient) PrepareProposalSync(req types.RequestPrepareProposal) (*
|
||||
return &res, nil
|
||||
}
|
||||
|
||||
func (app *localClient) ProcessProposalSync(
|
||||
ctx context.Context,
|
||||
req types.RequestProcessProposal,
|
||||
) (*types.ResponseProcessProposal, error) {
|
||||
func (app *localClient) ProcessProposalSync(req types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
|
||||
app.mtx.Lock()
|
||||
defer app.mtx.Unlock()
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/tendermint/tendermint/libs/service"
|
||||
tmsync "github.com/tendermint/tendermint/libs/sync"
|
||||
"github.com/tendermint/tendermint/libs/timer"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -435,16 +434,13 @@ func (cli *socketClient) PrepareProposalSync(req types.RequestPrepareProposal) (
|
||||
return reqres.Response.GetPrepareProposal(), cli.Error()
|
||||
}
|
||||
|
||||
func (cli *socketClient) ProcessProposalSync(
|
||||
ctx context.Context,
|
||||
req types.RequestProcessProposal,
|
||||
) (*types.ResponseProcessProposal, error) {
|
||||
|
||||
reqres, err := cli.queueRequestAndFlushSync(ctx, types.ToRequestProcessProposal(req))
|
||||
if err != nil {
|
||||
func (cli *socketClient) ProcessProposalSync(req types.RequestProcessProposal) (*types.ResponseProcessProposal, error) {
|
||||
reqres := cli.queueRequest(types.ToRequestProcessProposal(req))
|
||||
if err := cli.FlushSync(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return reqres.Response.GetProcessProposal(), nil
|
||||
|
||||
return reqres.Response.GetProcessProposal(), cli.Error()
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
@@ -141,13 +141,12 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
|
||||
func (blockExec *BlockExecutor) ProcessProposal(
|
||||
block *types.Block,
|
||||
) (bool, error) {
|
||||
ctx := context.Background()
|
||||
req := abci.RequestProcessProposal{
|
||||
Txs: block.Data.Txs.ToSliceOfBytes(),
|
||||
Header: *block.Header.ToProto(),
|
||||
}
|
||||
|
||||
resp, err := blockExec.proxyApp.ProcessProposalSync(ctx, req)
|
||||
resp, err := blockExec.proxyApp.ProcessProposalSync(req)
|
||||
if err != nil {
|
||||
return false, ErrInvalidBlock(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user