本文整理匯總了Golang中github.com/FactomProject/factomd/common/interfaces.IState.LoadDataByHash方法的典型用法代碼示例。如果您正苦於以下問題:Golang IState.LoadDataByHash方法的具體用法?Golang IState.LoadDataByHash怎麽用?Golang IState.LoadDataByHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/factomd/common/interfaces.IState
的用法示例。
在下文中一共展示了IState.LoadDataByHash方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: FollowerExecute
func (m *MissingData) FollowerExecute(state interfaces.IState) {
var dataObject interfaces.BinaryMarshallable
//var dataHash interfaces.IHash
rawObject, dataType, err := state.LoadDataByHash(m.RequestHash)
if rawObject != nil && err == nil { // If I don't have this message, ignore.
switch dataType {
case 0: // DataType = entry
dataObject = rawObject.(interfaces.IEBEntry)
//dataHash = dataObject.(interfaces.IEBEntry).GetHash()
case 1: // DataType = eblock
dataObject = rawObject.(interfaces.IEntryBlock)
//dataHash, _ = dataObject.(interfaces.IEntryBlock).Hash()
default:
return
}
msg := NewDataResponse(state, dataObject, dataType, m.RequestHash)
msg.SetOrigin(m.GetOrigin())
msg.SetNetworkOrigin(m.GetNetworkOrigin())
msg.SendOut(state, msg)
}
return
}