Browse Source

Get z_sendmany to actually execute!

We hit this error because we had no ZEC in a zaddr, as expected:

2017-11-21 05:31:34 opid-56f62a29-b5a6-4c8c-8c09-4484b8909662:
z_sendmany finished (status=failed, error=Insufficient funds, no unspent
notes found for zaddr from address.)

It seems that there may be a bug in sending arrays of one element and
how the get JSONified by Bitcoin::JSON::Client, not sure.
master
Jonathan "Duke" Leto 7 years ago
parent
commit
dee5c3fc17
  1. 9
      lib/Hush/List.pm

9
lib/Hush/List.pm

@ -307,11 +307,20 @@ sub send_message {
# 3. minconf (numeric, optional, default=1) Only use funds confirmed at least this many times.
# 4. fee (numeric, optional, default=0.0001) The fee amount to attach to this transaction.
# TODO: fix
my $rpc = Hush::RPC->new;
my $opid = $rpc->z_sendmany($from, [values $list_addrs]);
if (defined $opid) {
debug("send_message: z_sendmany opid=$opid from $from");
# omg we got an opid, lets see what is up
my @opids = ( $opid, 0 );
my $status = $rpc->z_getoperationstatus([@opids]);
if ($status) {
debug("send_message: $opid has status=$status");
} else {
debug("send_message: no status for opid=$opid");
}
} else {
debug("send_message: z_sendmany failed!");
}

Loading…
Cancel
Save