當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Bitcoin rescanblockchain用法及代碼示例

比特幣(Bitcoin) RPC Wallet API中rescanblockchain的用法及代碼示例。

用法:

rescanblockchain ( start_height stop_height )

重新掃描本地區塊鏈以進行與錢包相關的交易。

參數1 - start_height

類型:數字,可選,默認值= 0

重新掃描應開始的塊高度

參數2 - stop_height

類型:數字,可選

最後一個應該掃描的塊高。如果沒有提供,它將在此調用返回時重新掃描到尖端。

返回結果

{
  "start_height"     (numeric) The block height where the rescan started (the requested height or 0)
  "stop_height"      (numeric) The height of the last rescanned block. May be null in rare cases if there was a reorg and the call didn't scan any blocks because they were already scanned in the background.
}

示例

bitcoin-cli rescanblockchain 100000 120000
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "rescanblockchain", "params": [100000, 120000] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

相關用法


注:本文由純淨天空篩選整理自bitcoin.org大神的英文原創作品 Bitcoin rescanblockchain。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。