diff --git a/chain/events/tscache.go b/chain/events/tscache.go index 33493a4b8..a0d85e6e2 100644 --- a/chain/events/tscache.go +++ b/chain/events/tscache.go @@ -70,13 +70,14 @@ func (tsc *tipSetCache) get(height uint64) (*types.TipSet, error) { return nil, xerrors.Errorf("tipSetCache.get: requested tipset not in cache (req: %d, cache head: %d)", height, headH) } - tailH := tsc.cache[(tsc.start-tsc.len+1)%len(tsc.cache)].Height() + clen := len(tsc.cache) + tailH := tsc.cache[((tsc.start-tsc.len+1)% clen + clen) % clen].Height() if height < tailH { return tsc.storage(context.TODO(), height, tsc.cache[tailH]) } - return tsc.cache[int(height-tailH+1)%len(tsc.cache)], nil + return tsc.cache[(int(height-tailH+1) % clen + clen) % clen], nil } func (tsc *tipSetCache) best() *types.TipSet { diff --git a/lotuspond/front/src/Address.js b/lotuspond/front/src/Address.js index b41f3cdcb..64984716d 100644 --- a/lotuspond/front/src/Address.js +++ b/lotuspond/front/src/Address.js @@ -84,16 +84,16 @@ class Address extends React.Component { return info } - add10k = async () => { - [...Array(10).keys()].map(() => async () => await this.props.add1k(this.props.addr)).reduce(async (p, c) => [await p, await c()], Promise.resolve(null)) + add200k = async () => { + [...Array(10).keys()].map(() => async () => await this.props.add20k(this.props.addr)).reduce(async (p, c) => [await p, await c()], Promise.resolve(null)) } render() { - let add1k = - if(this.props.add1k) { - add1k = this.props.add1k(this.props.addr)}>[+1k] + let add20k = + if(this.props.add20k) { + add20k = this.props.add20k(this.props.addr)}>[+20k] if (this.props.add10k) { - add1k = {add1k} [+10k] + add20k = {add20k} [+200k] } } let addr = truncAddr(this.props.addr, this.props.short ? 12 : 17) @@ -133,7 +133,7 @@ class Address extends React.Component { minerInfo = Power: {this.state.minerInfo.MinerPower} ({this.state.minerInfo.MinerPower/this.state.minerInfo.TotalPower*100}%) } - return {addr}{balance}{actInfo}{nonce}{add1k}{transfer}{minerInfo} + return {addr}{balance}{actInfo}{nonce}{add20k}{transfer}{minerInfo} } } diff --git a/lotuspond/front/src/FullNode.js b/lotuspond/front/src/FullNode.js index edf620579..29a805273 100644 --- a/lotuspond/front/src/FullNode.js +++ b/lotuspond/front/src/FullNode.js @@ -15,7 +15,7 @@ class FullNode extends React.Component { this.newSecpAddr = this.newSecpAddr.bind(this) this.newBLSAddr = this.newBLSAddr.bind(this) this.startStorageMiner = this.startStorageMiner.bind(this) - this.add1k = this.add1k.bind(this) + this.add20k = this.add20k.bind(this) this.explorer = this.explorer.bind(this) this.client = this.client.bind(this) this.stop = this.stop.bind(this) @@ -84,8 +84,8 @@ class FullNode extends React.Component { this.props.spawnStorageNode(this.props.node.Repo, this.props.client) } - async add1k(to) { - await this.props.give1k(to) + async add20k(to) { + await this.props.give20k(to) } explorer() { @@ -123,14 +123,14 @@ class FullNode extends React.Component { let storageMine = [Spawn Storage Miner] let addresses = this.state.addrs.map((addr) => { - let line =
+ let line = if (this.state.defaultAddr === addr) { line = {line} } return