本文整理匯總了Golang中github.com/FactomProject/FactomCode/common.Hash.BTCString方法的典型用法代碼示例。如果您正苦於以下問題:Golang Hash.BTCString方法的具體用法?Golang Hash.BTCString怎麽用?Golang Hash.BTCString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/FactomCode/common.Hash
的用法示例。
在下文中一共展示了Hash.BTCString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: HaveBlockInDB
// HaveBlockInDB returns whether or not the chain instance has the block represented
// by the passed hash. This includes checking the various places a block can
// be like part of the main chain, on a side chain, or in the orphan pool.
//
// This function is NOT safe for concurrent access.
func HaveBlockInDB(hash *common.Hash) (bool, error) {
//util.Trace(spew.Sdump(hash))
blk, _ := db.FetchDBlockByHash(hash)
if blk != nil {
fmt.Println("HaveBlockInDB. true. ", hash.BTCString())
return true, nil
}
return false, nil
/*
if hash == nil || dchain.Blocks == nil || len(dchain.Blocks) == 0 {
return false, nil
}
// double check the block ids
for i := 0; i < len(dchain.Blocks); i = i + 1 {
if dchain.Blocks[i] == nil {
continue
}
if dchain.Blocks[i].DBHash == nil {
dchain.Blocks[i].DBHash, _ = common.CreateHash(dchain.Blocks[i])
}
if dchain.Blocks[i].DBHash.IsSameAs(hash) {
return true, nil
}
}
return false, nil */
}