From 586639907bbcf568089c04aced6669116888cdbf Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 16 Mar 2025 01:29:32 +0200 Subject: All date functions accumulated in _ak_utils --- bin/ak-mine | 3 ++- bin/ak-profile | 3 ++- bin/ak-transactions | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/ak-mine b/bin/ak-mine index 46e106d..00c7458 100755 --- a/bin/ak-mine +++ b/bin/ak-mine @@ -31,6 +31,7 @@ descriptionString="Sblock mining" source $AK_LIBDIR/_ak_log source $AK_LIBDIR/_ak_script +source $AK_LIBDIR/_ak_utils gather_zblocks(){ if [ "$(cat $AK_ZBLOCKSFILE | jq -r '.[].zblock' | wc -l)" -ne 0 ] @@ -56,7 +57,7 @@ proofofwork(){ i=1 l=1; while [ $l = 1 ] do - TIMESTAMP="$(date -u +%s)" + TIMESTAMP="$(_ak_datetime_unix)" SHA="$(echo -n $TEST'"nonce":"'$i'","previous":"'$PRE'","timestamp":"'$TIMESTAMP'","miner":"'$MINER'","reward":"40"}' | sha512sum | awk '{ print $1 }')" # Static difficulty for securing the sblock echo $SHA | grep -e '^000' diff --git a/bin/ak-profile b/bin/ak-profile index 97dcce3..a6ce3c8 100755 --- a/bin/ak-profile +++ b/bin/ak-profile @@ -45,6 +45,7 @@ ZPROFILEDIR="$AK_WORKDIR/profile" source $AK_LIBDIR/_ak_log source $AK_LIBDIR/_ak_script +source $AK_LIBDIR/_ak_utils source $AK_LIBDIR/_ak_ipfs source $AK_LIBDIR/_ak_gpg source $AK_LIBDIR/_ak_zblock @@ -202,7 +203,7 @@ _ak_modules_profile_add(){ FILE_SIGNATURE=$(_ak_ipfs_add $FILE_SIGN_FILE) cat > data < data <