generated from ipfs/ipfs-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 95
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 (#308)
Co-authored-by: hannahhoward <[email protected]>
- Loading branch information
1 parent
1f5df74
commit 5ba947b
Showing
6 changed files
with
80 additions
and
25 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
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 whose 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 | ||
} |