generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bitswap/client: add basic traceable blocks
Fixes #209
- Loading branch information
Showing
4 changed files
with
55 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package traceability | ||
|
||
import ( | ||
"time" | ||
|
||
blocks "github.com/ipfs/go-block-format" | ||
"github.com/libp2p/go-libp2p/core/peer" | ||
) | ||
|
||
// Block is a block whos provenance has been tracked. | ||
type Block struct { | ||
blocks.Block | ||
|
||
// From contains the peer id of the node who sent us the block. | ||
// It will be the zero value if we did not downloaded this block from the | ||
// network. (such as by getting the block from NotifyNewBlocks). | ||
From peer.ID | ||
// Delay contains how long did we had to wait between when we started being | ||
// intrested and when we actually got the block. | ||
Delay time.Duration | ||
} |