Skip to content

Commit 4766d31

Browse files
quantumagirowandh
authored andcommitted
Resolve warnings found in Stratis.Bitcoin.Features.Api (#771)
1 parent 36529df commit 4766d31

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Stratis.Bitcoin.Features.Api/NodeController.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public IActionResult ValidateAddress([FromQuery] string address)
385385

386386
if (result.IsValid)
387387
{
388-
var scriptPubKey = BitcoinAddress.Create(address, this.network).ScriptPubKey;
388+
NBitcoin.Script scriptPubKey = BitcoinAddress.Create(address, this.network).ScriptPubKey;
389389
result.ScriptPubKey = scriptPubKey.ToHex();
390390
result.IsWitness = scriptPubKey.IsWitness(this.network);
391391
}
@@ -453,7 +453,7 @@ public async Task<IActionResult> GetTxOutAsync([FromQuery] string trxid, uint vo
453453
/// <returns>The hex-encoded merkle proof.</returns>
454454
[Route("gettxoutproof")]
455455
[HttpGet]
456-
public async Task<IActionResult> GetTxOutProofAsync([FromQuery] string[] txids, string blockhash = "")
456+
public Task<IActionResult> GetTxOutProofAsync([FromQuery] string[] txids, string blockhash = "")
457457
{
458458
List<uint256> transactionIds = txids.Select(txString => uint256.Parse(txString)).ToList();
459459

@@ -500,7 +500,7 @@ public async Task<IActionResult> GetTxOutProofAsync([FromQuery] string[] txids,
500500

501501
var result = new MerkleBlock(block.Block, transactionIds.ToArray());
502502

503-
return this.Json(result);
503+
return Task.FromResult<IActionResult>(this.Json(result));
504504
}
505505

506506
/// <summary>
@@ -529,6 +529,8 @@ public IActionResult Shutdown([FromBody] bool corsProtection = true)
529529
/// Signals the node to rewind to the specified height.
530530
/// This will be done via writing a flag to the .conf file so that on startup it be executed.
531531
/// </summary>
532+
/// <param name="height">The rewind height.</param>
533+
/// <returns>A json text result indicating success or an <see cref="ErrorResult"/> indicating failure.</returns>
532534
[Route("rewind")]
533535
[HttpPut]
534536
[ProducesResponseType((int)HttpStatusCode.OK)]
@@ -697,7 +699,7 @@ public IActionResult GetAsyncLoops()
697699
/// <summary>
698700
/// Schedules data folder storing chain state in the <see cref="DataFolder"/> for deletion on the next graceful shutdown.
699701
/// </summary>
700-
/// <returns></returns>
702+
/// <returns>Returns an <see cref="OkResult"/>.</returns>
701703
[HttpDelete]
702704
[Route("datafolder/chain")]
703705
public IActionResult DeleteChain()
@@ -717,7 +719,7 @@ public IActionResult DeleteChain()
717719
/// <exception cref="ArgumentNullException">Thrown if fullnode is not provided.</exception>
718720
internal ChainedHeader GetTransactionBlock(uint256 trxid, ChainIndexer chain)
719721
{
720-
Guard.NotNull(fullNode, nameof(fullNode));
722+
Guard.NotNull(this.fullNode, nameof(this.fullNode));
721723

722724
ChainedHeader block = null;
723725
uint256 blockid = this.blockStore?.GetBlockIdByTransactionId(trxid);

0 commit comments

Comments
 (0)