From fe928f8f877d7256bf7598854683554fc7a204f8 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 16 Nov 2023 14:17:19 +0200 Subject: [PATCH] resolve too-long-mempool-chain rejects --- README.md | 3 ++- kevacoin/put.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4abc84..f73f888 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,13 @@ CLI util to operate with large objects in small blocks size export FS object to blockchain namespace ``` -php kevacoin/put.php processor filename [length] +php kevacoin/put.php processor filename [length] [delay] ``` * `processor` - path to `kevacoin-cli` * `filename` - file path to store in blockchain * `length` - optional split size, 3072 bytes [max](https://kevacoin.org/faq.html) +* `delay` - optional seconds of parts sending delay to prevent `too-long-mempool-chain` reject, 60 by default ### get diff --git a/kevacoin/put.php b/kevacoin/put.php index 2222322..27b63a3 100644 --- a/kevacoin/put.php +++ b/kevacoin/put.php @@ -60,5 +60,16 @@ if (!empty($kevaNamespace->namespaceId)) ); print_r($kevaPut); + + $delay = isset($argv[4]) ? (int) $argv[4] : 60; + + echo sprintf( + '%s/%s sent, waiting %s seconds...' . PHP_EOL, + $key + 1, + count($parts), + $delay + ); + + sleep($delay); } } \ No newline at end of file