Skip to content

Commit

Permalink
Update to latest mixing module
Browse files Browse the repository at this point in the history
This update includes debug logging added to mixpool's AcceptMessage method, so
some additional and now duplicate logging can be removed.  This also has the
side effect of logging the same messages in SPV mode, and with matching
messages to dcrd also running with mixpool debug logging.
  • Loading branch information
jrick committed May 30, 2024
1 parent 0b296aa commit 7a79aa8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
16 changes: 1 addition & 15 deletions chain/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"time"

"decred.org/dcrwallet/v4/errors"
"decred.org/dcrwallet/v4/internal/loggers"
"decred.org/dcrwallet/v4/rpc/client/dcrd"
"decred.org/dcrwallet/v4/validate"
"decred.org/dcrwallet/v4/wallet"
Expand Down Expand Up @@ -926,16 +925,8 @@ func (s *Syncer) mixMessage(ctx context.Context, params json.RawMessage) error {
s.blake256HasherMu.Lock()
msg.WriteHash(s.blake256Hasher)
s.blake256HasherMu.Unlock()
msgHash := msg.Hash()
err = s.wallet.AcceptMixMessage(msg)
if err == nil {
loggers.MixpLog.Debugf("Accepted mix message %T %s by %x",
msg, &msgHash, msg.Pub())
} else {
loggers.MixpLog.Debugf("Rejected mix message %T %s by %x",
msg, &msgHash, msg.Pub())
}

err = s.wallet.AcceptMixMessage(msg)
var e *mixpool.MissingOwnPRError
if errors.As(err, &e) {
ke, ok := msg.(*wire.MsgMixKeyExchange)
Expand All @@ -947,13 +938,8 @@ func (s *Syncer) mixMessage(ctx context.Context, params json.RawMessage) error {
s.blake256HasherMu.Lock()
pr.WriteHash(s.blake256Hasher)
s.blake256HasherMu.Unlock()
prHash := pr.Hash()

err = s.wallet.AcceptMixMessage(pr)
if err == nil {
loggers.MixpLog.Debugf("Accepted missing PR %s for "+
"previous orphan KE %s", &prHash, &msgHash)
}
}
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/decred/dcrd/dcrutil/v4 v4.0.2
github.com/decred/dcrd/gcs/v4 v4.1.0
github.com/decred/dcrd/hdkeychain/v3 v3.1.2
github.com/decred/dcrd/mixing v0.2.1-0.20240529162252-394b25699e29
github.com/decred/dcrd/mixing v0.2.1-0.20240530202656-ec03b5bab879
github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.3.0
github.com/decred/dcrd/rpcclient/v8 v8.0.1
github.com/decred/dcrd/txscript/v4 v4.1.1
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ github.com/decred/dcrd/gcs/v4 v4.1.0 h1:tpW7JW53yJZlgNwl/n2NL1b8NxHaIPRUyNuLMkB/
github.com/decred/dcrd/gcs/v4 v4.1.0/go.mod h1:nPTbGM/I3Ihe5KFvUmxZEqQP/jDZQjQ63+WEi/f4lqU=
github.com/decred/dcrd/hdkeychain/v3 v3.1.2 h1:x25WuuE7zM/20EynuVMyOhL0K8BwGBBsexGq8xTiHFA=
github.com/decred/dcrd/hdkeychain/v3 v3.1.2/go.mod h1:FnNJmZ7jqUDeAo6/c/xkQi5cuxh3EWtJeMmW6/Z8lcc=
github.com/decred/dcrd/mixing v0.2.1-0.20240528211104-8948c217c027 h1:6Npwi0qe5zrEDnasIceh+yYtlA3cIkl/5COykWJgoko=
github.com/decred/dcrd/mixing v0.2.1-0.20240528211104-8948c217c027/go.mod h1:W3K7yJKmoI03G2U5Yw+HSRNe6lLBegi63ZR6fFLnM9c=
github.com/decred/dcrd/mixing v0.2.1-0.20240529162252-394b25699e29 h1:DuR1/EakeiLh3B0bSH/z5+PseWAVIAjIVTtegiJRKN0=
github.com/decred/dcrd/mixing v0.2.1-0.20240529162252-394b25699e29/go.mod h1:W3K7yJKmoI03G2U5Yw+HSRNe6lLBegi63ZR6fFLnM9c=
github.com/decred/dcrd/mixing v0.2.1-0.20240530202656-ec03b5bab879 h1:j4xJ120CN/7WVhT4v+VfoniJDaCXu4MvrLX+hKMwqBw=
github.com/decred/dcrd/mixing v0.2.1-0.20240530202656-ec03b5bab879/go.mod h1:W3K7yJKmoI03G2U5Yw+HSRNe6lLBegi63ZR6fFLnM9c=
github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.3.0 h1:l0DnCcILTNrpy8APF3FLN312ChpkQaAuW30aC/RgBaw=
github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.3.0/go.mod h1:j+kkRPXPJB5S9VFOsx8SQLcU7PTFkPKRc1aCHN4ENzA=
github.com/decred/dcrd/rpcclient/v8 v8.0.1 h1:hd81e4w1KSqvPcozJlnz6XJfWKDNuahgooH/N5E8vOU=
Expand Down

0 comments on commit 7a79aa8

Please sign in to comment.