Since I'm using the wonderful accounts feature which is soon to be deprecated (shame on me, i know - but i simply didn't have resources and time as a single person to do an internal accounting system in a few weeks alongside everything else the project contains, this is a school project and will not be deployed), i was wondering how to handle sending transactions & change addresses, without using raw transactions.
Would the following work
SendMany(fromacc, toaddress: amount, 1, "comment", subtractfee)
(I'm planning to use SendMany for single transactions, because it has the subtractfee parameter compared to SendFrom).
Use the resulting TXID to query Blockcypher API (https://api.blockcypher.com/v1/btc/main/txs/b7bf53a74a4e4cb61ab523cc002fc4cea83fb359471d02b212d947cf86fe6077) and "grab" the change address from there (Since Bitcoin Core doesn't allow this wihout using rawtransactions?)
VerifyAddress(changeaddress) SetAccount(account, changeaddress)
Which means that GetBalance(account) should show the correct balance of the account and not 0?
Or should i really not do that and use rawtransactions instead? :-)
So i just realised that i confused the subtractfee parameter in SendMany from the one in SendToAddress (which is what i need), so i suppose i need to use that instead.
$balance = getBalance($myaccount) move("", $myaccount, $sendingamount, "", "comment") SendToAddress($receiveaddr, $sendingamount, "comment", "commentto", 1, 0, 6)
do the the blockcypher grab TX id, verifyaddress and set account here
$newBalance = getBalance($myaccount) $change = $balance - $sendingamount move("", $myaccount, $change, "", "comment")
Work in this case and would listunspent show the amount under the right account (not "")?
Also here is what I'm trying to do from a user perspective: https://imgur.com/a/IHrF4vI