Merge pull request #376 from filecoin-project/fix/statepower
Fix lotus state power
This commit is contained in:
commit
1f9b3755bd
@ -70,14 +70,14 @@ func GetMinerOwner(ctx context.Context, sm *StateManager, st cid.Cid, maddr addr
|
|||||||
|
|
||||||
func GetPower(ctx context.Context, sm *StateManager, ts *types.TipSet, maddr address.Address) (types.BigInt, types.BigInt, error) {
|
func GetPower(ctx context.Context, sm *StateManager, ts *types.TipSet, maddr address.Address) (types.BigInt, types.BigInt, error) {
|
||||||
var err error
|
var err error
|
||||||
enc, err := actors.SerializeParams(&actors.PowerLookupParams{maddr})
|
|
||||||
if err != nil {
|
|
||||||
return types.EmptyInt, types.EmptyInt, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var mpow types.BigInt
|
var mpow types.BigInt
|
||||||
|
|
||||||
if maddr != address.Undef {
|
if maddr != address.Undef {
|
||||||
|
enc, aerr := actors.SerializeParams(&actors.PowerLookupParams{maddr})
|
||||||
|
if aerr != nil {
|
||||||
|
return types.EmptyInt, types.EmptyInt, aerr
|
||||||
|
}
|
||||||
ret, err := sm.Call(ctx, &types.Message{
|
ret, err := sm.Call(ctx, &types.Message{
|
||||||
From: maddr,
|
From: maddr,
|
||||||
To: actors.StorageMarketAddress,
|
To: actors.StorageMarketAddress,
|
||||||
|
Loading…
Reference in New Issue
Block a user