reject zero send amounts (#799)

This commit is contained in:
wiesche
2026-09-21 20:41:34 +02:00
committed by GitHub
parent f31f307767
commit 4a487390bd
8 changed files with 104 additions and 14 deletions
+4
View File
@@ -65,6 +65,10 @@ where
C: NodeClient,
K: Keychain,
{
if slate.amount == 0 {
return Err(Error::InvalidAmount);
}
let mut ret_slate = slate.clone();
if ret_slate.state != SlateState::Standard1 {
return Err(Error::SlateState);
+12
View File
@@ -534,6 +534,10 @@ where
C: NodeClient,
K: Keychain,
{
if args.amount == 0 {
return Err(Error::InvalidAmount);
}
let payment_proof_address = if let Some(a) = &args.payment_proof_recipient_address {
if a.valid_network() {
Some(a)
@@ -657,6 +661,10 @@ where
C: NodeClient,
K: Keychain,
{
if args.amount == 0 {
return Err(Error::InvalidAmount);
}
let parent_key_id = match args.dest_acct_name {
Some(d) => {
let pm = w.get_acct_path(d)?;
@@ -710,6 +718,10 @@ where
C: NodeClient,
K: Keychain,
{
if slate.amount == 0 {
return Err(Error::InvalidAmount);
}
let mut ret_slate = slate.clone();
check_ttl(w, &ret_slate)?;
let parent_key_id = match args.src_acct_name {