|
|
@ -7,7 +7,7 @@ import com.alexitc.playsonify.models.pagination.{Limit, Offset, PaginatedQuery} |
|
|
|
import com.alexitc.playsonify.validators.PaginatedQueryValidator |
|
|
|
import com.xsn.explorer.cache.BlockHeaderCache |
|
|
|
import com.xsn.explorer.data.async.BlockFutureDataHandler |
|
|
|
import com.xsn.explorer.errors.BlockRewardsNotFoundError |
|
|
|
import com.xsn.explorer.errors.{BlockRewardsNotFoundError, XSNMessageError} |
|
|
|
import com.xsn.explorer.models._ |
|
|
|
import com.xsn.explorer.models.persisted.BlockHeader |
|
|
|
import com.xsn.explorer.models.rpc.{Block, TransactionVIN} |
|
|
@ -159,6 +159,15 @@ class BlockService @Inject() ( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
def estimateFee(nBlocks: Int): FutureApplicationResult[JsValue] = { |
|
|
|
if (nBlocks >= 1 && nBlocks <= 1000) { |
|
|
|
xsnService.estimateSmartFee(nBlocks) |
|
|
|
} else { |
|
|
|
val error = XSNMessageError("The nBlocks should be between 1 and 1000") |
|
|
|
Future.successful(Bad(error).accumulating) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private def isPoS(block: rpc.Block): FutureApplicationResult[Boolean] = { |
|
|
|
val result = for { |
|
|
|
coinbaseTxid <- blockLogic.getCoinbase(block).toFutureOr |
|
|
|