Skip to content

Commit

Permalink
fix: fix dht put
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengwen Yu authored and ZhiminHeGit committed Jun 25, 2019
1 parent f6ce307 commit fc8afb4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions patches/go-ipns-v.0.0.1-record.go.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- github.com/ipfs/[email protected]/record.go 2019-06-24 16:16:28.000000000 +0800
+++ /Users/tron/patch-from/go-ipns/v0.0.1/record.go 2019-06-24 16:12:55.000000000 +0800
@@ -34,7 +34,7 @@
// Validate validates an IPNS record.
func (v Validator) Validate(key string, value []byte) error {
ns, pidString, err := record.SplitKey(key)
- if err != nil || ns != "ipns" {
+ if err != nil || (ns != "ipns" && ns != "btns") {
return ErrInvalidPath
}

7 changes: 7 additions & 0 deletions patching.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@ patchdir=$GOPATH/pkg/mod/github.com/libp2p/[email protected]
chmod -R 777 $patchdir
if ! patch -R -s -f --dry-run $patchdir/validator.go < ./patches/go-libp2p-record-v0.0.1-validator.go.patch 1>/dev/null; then
patch $patchdir/validator.go < ./patches/go-libp2p-record-v0.0.1-validator.go.patch;
fi

# patching $GOPATH/pkg/mod/github.com/ipfs/[email protected]
patchdir=$GOPATH/pkg/mod/github.com/ipfs/[email protected]
chmod -R 777 $patchdir
if ! patch -R -s -f --dry-run $patchdir/record.go < ./patches/go-ipns-v.0.0.1-record.go.patch 1>/dev/null; then
patch $patchdir/record.go < ./patches/go-ipns-v.0.0.1-record.go.patch;
fi

0 comments on commit fc8afb4

Please sign in to comment.