mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
rpc/notary: make this branch mergeable with master
This commit is contained in:
parent
64710fc3f9
commit
711e21709f
2 changed files with 4 additions and 4 deletions
|
@ -117,9 +117,9 @@ func NewWS(ctx context.Context, endpoint string, opts Options) (*WSClient, error
|
||||||
// unusable.
|
// unusable.
|
||||||
func (c *WSClient) Close() {
|
func (c *WSClient) Close() {
|
||||||
if c.closeCalled.CAS(false, true) {
|
if c.closeCalled.CAS(false, true) {
|
||||||
// Closing shutdown channel send signal to wsWriter to break out of the
|
// Closing shutdown channel sends a signal to wsWriter to break out of the
|
||||||
// loop. In doing so it does ws.Close() closing the network connection
|
// loop. In doing so it does ws.Close() closing the network connection
|
||||||
// which in turn makes wsReader receieve err from ws,ReadJSON() and also
|
// which in turn makes wsReader receive an err from ws.ReadJSON() and also
|
||||||
// break out of the loop closing c.done channel in its shutdown sequence.
|
// break out of the loop closing c.done channel in its shutdown sequence.
|
||||||
close(c.shutdown)
|
close(c.shutdown)
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ func (n *Notary) OnNewRequest(payload *payload.P2PNotaryRequest) {
|
||||||
r.minNotValidBefore = nvbFallback
|
r.minNotValidBefore = nvbFallback
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Avoid changes in main transaction witnesses got from notary request pool to
|
// Avoid changes in the main transaction witnesses got from the notary request pool to
|
||||||
// keep the pooled tx valid. We will update its copy => the copy's size will be changed.
|
// keep the pooled tx valid. We will update its copy => the copy's size will be changed.
|
||||||
cp := *payload.MainTransaction
|
cp := *payload.MainTransaction
|
||||||
cp.Scripts = make([]transaction.Witness, len(payload.MainTransaction.Scripts))
|
cp.Scripts = make([]transaction.Witness, len(payload.MainTransaction.Scripts))
|
||||||
|
@ -234,7 +234,7 @@ func (n *Notary) OnNewRequest(payload *payload.P2PNotaryRequest) {
|
||||||
if r.witnessInfo == nil && validationErr == nil {
|
if r.witnessInfo == nil && validationErr == nil {
|
||||||
r.witnessInfo = newInfo
|
r.witnessInfo = newInfo
|
||||||
}
|
}
|
||||||
// Allow modification of fallback transaction got from notary request pool.
|
// Allow modification of a fallback transaction got from the notary request pool.
|
||||||
// It has dummy Notary witness attached => its size won't be changed.
|
// It has dummy Notary witness attached => its size won't be changed.
|
||||||
r.fallbacks = append(r.fallbacks, payload.FallbackTransaction)
|
r.fallbacks = append(r.fallbacks, payload.FallbackTransaction)
|
||||||
if exists && r.isMainCompleted() || validationErr != nil {
|
if exists && r.isMainCompleted() || validationErr != nil {
|
||||||
|
|
Loading…
Reference in a new issue