Files
2025-08-02 15:20:14 -05:00

32 lines
798 B
Go

// Copyright © 2019 Binance
//
// This file is part of Binance. The full Binance copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
package test
import (
"github.com/luxfi/tss/v2/tss"
)
func SharedPartyUpdater(party tss.Party, msg tss.Message, errCh chan<- *tss.Error) {
// do not send a message from this party back to itself
if party.PartyID() == msg.GetFrom() {
return
}
bz, _, err := msg.WireBytes()
if err != nil {
errCh <- party.WrapError(err)
return
}
pMsg, err := tss.ParseWireMessage(bz, msg.GetFrom(), msg.IsBroadcast())
if err != nil {
errCh <- party.WrapError(err)
return
}
if _, err := party.Update(pMsg); err != nil {
errCh <- err
}
}