aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/GitVersion.cmake7
-rw-r--r--src/wallet/wallet_rpc_helpers.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake
index a367787f1..7eaf3ddf1 100644
--- a/cmake/GitVersion.cmake
+++ b/cmake/GitVersion.cmake
@@ -32,6 +32,7 @@
function (get_version_tag_from_git GIT)
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -47,7 +48,11 @@ function (get_version_tag_from_git GIT)
message(STATUS "You are currently on commit ${COMMIT}")
# Get all the tags
- execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ RESULT_VARIABLE RET
+ OUTPUT_VARIABLE TAGGEDCOMMIT
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT TAGGEDCOMMIT)
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
diff --git a/src/wallet/wallet_rpc_helpers.h b/src/wallet/wallet_rpc_helpers.h
index 91803ff77..4291a112d 100644
--- a/src/wallet/wallet_rpc_helpers.h
+++ b/src/wallet/wallet_rpc_helpers.h
@@ -65,7 +65,7 @@ namespace tools
rpc_payment_state.credits = post_call_credits;
rpc_payment_state.expected_spent += expected_credits;
- if (pre_call_credits < post_call_credits)
+ if (pre_call_credits <= post_call_credits)
return;
uint64_t cost = pre_call_credits - post_call_credits;