Update IBC commands

This commit is contained in:
Christopher Goes 2018-04-03 22:23:09 +02:00
parent 457092d662
commit cdbb994e3f
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 3 additions and 9 deletions

View File

@ -132,10 +132,8 @@ OUTER:
continue OUTER
}
viper.Set(client.FlagSequence, seq)
err = c.broadcastTx(seq, toChainNode, c.refine(egressbz, i, passphrase))
seq++
err = c.broadcastTx(toChainNode, c.refine(egressbz, i, passphrase))
if err != nil {
c.logger.Error("Error broadcasting ingress packet", "err", err)
continue OUTER
@ -150,8 +148,8 @@ func query(node string, key []byte, storeName string) (res []byte, err error) {
return context.NewCoreContextFromViper().WithNodeURI(node).Query(key, storeName)
}
func (c relayCommander) broadcastTx(node string, tx []byte) error {
_, err := context.NewCoreContextFromViper().WithNodeURI(node).WithSequence(c.getSequence(node) + 1).BroadcastTx(tx)
func (c relayCommander) broadcastTx(seq int64, node string, tx []byte) error {
_, err := context.NewCoreContextFromViper().WithNodeURI(node).WithSequence(seq + 1).BroadcastTx(tx)
return err
}
@ -169,10 +167,6 @@ func (c relayCommander) getSequence(node string) int64 {
return account.GetSequence()
}
func setSequence(seq int64) {
viper.Set(client.FlagSequence, seq)
}
func (c relayCommander) refine(bz []byte, sequence int64, passphrase string) []byte {
var packet ibc.IBCPacket
if err := c.cdc.UnmarshalBinary(bz, &packet); err != nil {