We need to wrap our getbalance call due to issues in the coind and
payout systems in the RPC. Apparently it's having issues with multiple
accounts setup in a single wallet. Sendmany can not properly use other
accounts added to the wallet as the payout account.
Hence we wrap our getbalance call in the RPC and only return the default
account balance at all times. Since this is used for all payouts and for
payments from blocks, there should be no issue. Those pools running
multiple accounts in their wallet will have to move their coins into the
default wallet!
We can now run payouts via sendmany:
* No big logical changes, sendmany is called once for MP and once for AP
* Instead of paying out via sendtoaddress, store in array and use
sendmany later
* Update all transactions with the RPC TXID returned by sendmany
Will fix#1238 once merged.
* Validate all DB transactions against your payouts in the RPC
* Does not use TXID to search for records but rather a combination of
address and amount
* May help debugging issues
Without this patch, admin.php checks if it can connect to the wallet service. Regardless of if that check passes or fails, it then checks if the cold wallet address is valid. If the can_connect() test failed, the validateaddress() check will also fail, even if the address is not invalid. To fix this, the validateaddress() check is move to an elseif block in the can_connect() chain.
Additionally, this patch checks to see if the wallet service is running as a testnet. While running as a testnet is perfectly acceptable when testing, the suer should be warned. A lot of folks using the quickstart guide miss this.
A function was added to the Bitcoin class to detect when we are running in a test net. A check was added to admin.php, and the existing can_connect and validateaddress() calls were restructured to solve these issues.