diff --git a/src/main/resources/api/openapi.yaml b/src/main/resources/api/openapi.yaml index 24afaa165c..d7fb5d1859 100644 --- a/src/main/resources/api/openapi.yaml +++ b/src/main/resources/api/openapi.yaml @@ -2705,7 +2705,7 @@ paths: /blocks/headerIds: post: - summary: Get the list of full block info by given header ids + summary: Get full blocks by given header ids operationId: getFullBlockByIds tags: - blocks @@ -2727,7 +2727,7 @@ paths: items: $ref: '#/components/schemas/FullBlock' '404': - description: Blocks with this ids doesn't exist + description: No block exist for every id provided content: application/json: schema: @@ -5126,7 +5126,7 @@ paths: /utxo/withPool/byIds: post: - summary: Get boxes JSONs for ids in array provided, from UTXO or the mempool. + summary: Get boxes for ids provided, from UTXO or the mempool. operationId: getBoxWithPoolByIds tags: - utxo @@ -5148,7 +5148,7 @@ paths: items: $ref: '#/components/schemas/ErgoTransactionOutput' '404': - description: Any boxes from the list with this id doesn't exist + description: No any box exists for every id provided content: application/json: schema: diff --git a/src/main/scala/org/ergoplatform/http/api/BlockchainApiRoute.scala b/src/main/scala/org/ergoplatform/http/api/BlockchainApiRoute.scala index 3547f20d50..e5cb090761 100644 --- a/src/main/scala/org/ergoplatform/http/api/BlockchainApiRoute.scala +++ b/src/main/scala/org/ergoplatform/http/api/BlockchainApiRoute.scala @@ -382,9 +382,9 @@ case class BlockchainApiRoute(readersHolder: ActorRef, ergoSettings: ErgoSetting getHistoryWithMempool.map { case (history, mempool) => getAddress(address)(history) match { case Some(addr) => - (addr.balanceInfo.get.retreiveAdditionalTokenInfo(history), getUnconfirmedForAddress(address)(mempool).retreiveAdditionalTokenInfo(history)) + (addr.balanceInfo.get.retrieveAdditionalTokenInfo(history), getUnconfirmedForAddress(address)(mempool).retrieveAdditionalTokenInfo(history)) case None => - (BalanceInfo(), getUnconfirmedForAddress(address)(mempool).retreiveAdditionalTokenInfo(history)) + (BalanceInfo(), getUnconfirmedForAddress(address)(mempool).retrieveAdditionalTokenInfo(history)) } } } diff --git a/src/main/scala/org/ergoplatform/nodeView/history/extra/BalanceInfo.scala b/src/main/scala/org/ergoplatform/nodeView/history/extra/BalanceInfo.scala index 67a6fb1a1d..adbd35eecc 100644 --- a/src/main/scala/org/ergoplatform/nodeView/history/extra/BalanceInfo.scala +++ b/src/main/scala/org/ergoplatform/nodeView/history/extra/BalanceInfo.scala @@ -27,7 +27,7 @@ case class BalanceInfo() extends ScorexLogging { * @param history - database handle * @return this object */ - def retreiveAdditionalTokenInfo(history: ErgoHistoryReader): BalanceInfo = { + def retrieveAdditionalTokenInfo(history: ErgoHistoryReader): BalanceInfo = { additionalTokenInfo ++= tokens.map(token => { history.typedExtraIndexById[IndexedToken](uniqueId(token._1)) match { case Some(iT) => (token._1,(iT.name,iT.decimals)) diff --git a/src/main/scala/scorex/core/network/NetworkController.scala b/src/main/scala/scorex/core/network/NetworkController.scala index 4f31089b11..16995e7e69 100644 --- a/src/main/scala/scorex/core/network/NetworkController.scala +++ b/src/main/scala/scorex/core/network/NetworkController.scala @@ -301,7 +301,7 @@ class NetworkController(ergoSettings: ErgoSettings, val lastSeen = peerInfo.lastStoredActivityTime val timeout = networkSettings.inactiveConnectionDeadline.toMillis val delta = now - lastSeen - if (delta > timeout) { + if (delta > timeout && lastSeen > 0) { log.info(s"Dropping connection with ${peerInfo}, last seen ${delta / 1000.0} seconds ago") cp.handlerRef ! CloseConnection } diff --git a/src/main/scala/scorex/core/network/peer/PeerInfo.scala b/src/main/scala/scorex/core/network/peer/PeerInfo.scala index b7ba46f025..b95bafa938 100644 --- a/src/main/scala/scorex/core/network/peer/PeerInfo.scala +++ b/src/main/scala/scorex/core/network/peer/PeerInfo.scala @@ -51,14 +51,12 @@ object PeerInfoSerializer extends ErgoSerializer[PeerInfo] { w.putLong(obj.lastHandshake) w.putOption(obj.connectionType)((w,d) => w.putBoolean(d.isIncoming)) PeerSpecSerializer.serialize(obj.peerSpec, w) - w.putLong(obj.lastStoredActivityTime) } override def parse(r: Reader): PeerInfo = { val lastHandshake = r.getLong() val connectionType = r.getOption(if (r.getUByte() != 0) Incoming else Outgoing) val peerSpec = PeerSpecSerializer.parse(r) - val lastStoredTime = r.getLong() - PeerInfo(peerSpec, lastHandshake, connectionType, lastStoredTime) + PeerInfo(peerSpec, lastHandshake, connectionType, lastStoredActivityTime = 0L) } }