ソースを参照

contrib/localnet/darkfid-small/reorg-test: wait for 20 blocks to be mined before starting the test

oars 6 ヶ月 前
コミット
547e9d6e7d
1 ファイル変更8 行追加0 行削除
  1. 8 0
      contrib/localnet/darkfid-small/reorg-test.sh

+ 8 - 0
contrib/localnet/darkfid-small/reorg-test.sh

@@ -32,6 +32,14 @@ else
 	verbose=""
 fi
 
+wait_blocks() {
+    while [ "$(sh ./sync-wallet.sh "$1" | grep 'Last confirmed block reported by darkfid:' | awk 'NR==1 {print $7}')" -lt "$2" ]; do
+        sleep 5
+    done
+}
+
+# Start test after 20 blocks are mined
+wait_blocks "$DRK0" 20
 
 echo "=========[Stopping Node1 and Node2]=========="
 # Stop node1 and mine only with node0