Merge remote-tracking branch 'origin/dev' into changelog-v0.12.5

This commit is contained in:
Ori Newman 2022-08-28 13:21:07 +03:00
commit 90f9c6455b

View File

@ -65,7 +65,12 @@ func send(conf *sendConfig) error {
fmt.Printf("Broadcasting %d transactions\n", len(signedTransactions))
}
response, err := daemonClient.Broadcast(ctx, &pb.BroadcastRequest{Transactions: signedTransactions})
// Since we waited for user input when getting the password, which could take unbound amount of time -
// create a new context for broadcast, to reset the timeout.
broadcastCtx, broadcastCancel := context.WithTimeout(context.Background(), daemonTimeout)
defer broadcastCancel()
response, err := daemonClient.Broadcast(broadcastCtx, &pb.BroadcastRequest{Transactions: signedTransactions})
if err != nil {
return err
}