RPC: fix stake weight calculation